/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-qingdao' = 'r-kvstore.aliyuncs.com',
    'cn-beijing' = 'r-kvstore.aliyuncs.com',
    'cn-wulanchabu' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou' = 'r-kvstore.aliyuncs.com',
    'cn-shanghai' = 'r-kvstore.aliyuncs.com',
    'cn-shenzhen' = 'r-kvstore.aliyuncs.com',
    'cn-heyuan' = 'r-kvstore.aliyuncs.com',
    'cn-guangzhou' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou-finance' = 'r-kvstore.aliyuncs.com',
    'cn-shanghai-finance-1' = 'r-kvstore.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'r-kvstore.aliyuncs.com',
    'cn-north-2-gov-1' = 'r-kvstore.aliyuncs.com',
    'ap-northeast-2-pop' = 'r-kvstore.aliyuncs.com',
    'cn-beijing-finance-1' = 'r-kvstore.aliyuncs.com',
    'cn-beijing-finance-pop' = 'r-kvstore.aliyuncs.com',
    'cn-beijing-gov-1' = 'r-kvstore.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'r-kvstore.aliyuncs.com',
    'cn-edge-1' = 'r-kvstore.aliyuncs.com',
    'cn-fujian' = 'r-kvstore.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'r-kvstore.aliyuncs.com',
    'cn-hangzhou-test-306' = 'r-kvstore.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'r-kvstore.aliyuncs.com',
    'cn-qingdao-nebula' = 'r-kvstore.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'r-kvstore.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'r-kvstore.aliyuncs.com',
    'cn-shanghai-inner' = 'r-kvstore.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'r-kvstore.aliyuncs.com',
    'cn-shenzhen-inner' = 'r-kvstore.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'r-kvstore.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'r-kvstore.aliyuncs.com',
    'cn-wuhan' = 'r-kvstore.aliyuncs.com',
    'cn-yushanfang' = 'r-kvstore.aliyuncs.com',
    'cn-zhangbei' = 'r-kvstore.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'r-kvstore.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'r-kvstore.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'r-kvstore.aliyuncs.com',
    'eu-west-1-oxs' = 'r-kvstore.aliyuncs.com',
    'rus-west-1-pop' = 'r-kvstore.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('r-kvstore', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddShardingNodeRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true**: enables automatic payment. Make sure that you have sufficient balance within your account.
*   **false**: disables automatic payment. In this case, you must manually renew the instance in the console before the instance expires. For more information, see [Renewal](https://help.aliyun.com/document_detail/26352.html).

> The default value is **true**.', example='false'),
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='000000000'),
  couponNo?: string(name='CouponNo', description='The ID of the coupon.', example='youhuiquan_promotion_option_id_for_blank'),
  forceTrans?: boolean(name='ForceTrans', description='Specifies whether to enable forced transmission during a configuration change. Valid values:

*   **false** (default): Before the configuration change, the system checks the minor version of the instance. If the minor version of the instance is outdated, an error is reported. You must update the minor version of the instance and try again.
*   **true**: The system skips the version check and directly performs the configuration change.', example='false'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  shardCount?: int32(name='ShardCount', description='The number of data shards that you want to add. Default value: **1**.

>  The instance can contain 2 to 256 data shards. You can add up to 64 data shards at a time. Make sure that the number of shards does not exceed this limit.', example='2'),
  sourceBiz?: string(name='SourceBiz', description='The source of the operation. This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID. You can specify a different vSwitch within the same virtual private cloud (VPC). In this case, the new data shards are created in the specified vSwitch. If you do not specify this parameter, the new data shards are created in the original vSwitch.', example='vsw-bp1e7clcw529l773d****'),
}

model AddShardingNodeResponseBody = {
  nodeIds?: [ string ](name='NodeIds', description='The IDs of the data shards.'),
  orderId?: long(name='OrderId', description='The ID of the order.', example='20741011111111'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B79C1A90-495B-4E99-A2AA-A4DB13B8****'),
}

model AddShardingNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddShardingNodeResponseBody(name='body'),
}

/**
 * @summary Adds one or more data shards to an ApsaraDB for Redis cluster instance.
 *
 * @description This operation is available only for cluster instances that use cloud disks.
 *
 * @param request AddShardingNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddShardingNodeResponse
 */
async function addShardingNodeWithOptions(request: AddShardingNodeRequest, runtime: $RuntimeOptions): AddShardingNodeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.forceTrans)) {
    query['ForceTrans'] = request.forceTrans;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.shardCount)) {
    query['ShardCount'] = request.shardCount;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddShardingNode',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds one or more data shards to an ApsaraDB for Redis cluster instance.
 *
 * @description This operation is available only for cluster instances that use cloud disks.
 *
 * @param request AddShardingNodeRequest
 * @return AddShardingNodeResponse
 */
async function addShardingNode(request: AddShardingNodeRequest): AddShardingNodeResponse {
  var runtime = new $RuntimeOptions{};
  return addShardingNodeWithOptions(request, runtime);
}

model AllocateDirectConnectionRequest {
  connectionString?: string(name='ConnectionString', description='The prefix of the private endpoint. The prefix must start with a lowercase letter and can contain lowercase letters and digits. The prefix must be 8 to 40 characters in length.', example='redisdirect123'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  port?: string(name='Port', description='The port number of the instance. Valid values: **1024** to **65535**. Default value: **6379**.', example='6379'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model AllocateDirectConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model AllocateDirectConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateDirectConnectionResponseBody(name='body'),
}

/**
 * @summary Applies for a private endpoint for a Tair (Redis OSS-compatible) instance.
 *
 * @description Clients can bypass proxy nodes and use private endpoints to connect to cluster instances. This is similar to the connection to native Redis clusters. The direct connection mode can reduce communication overheads and the response time of Tair (Redis OSS-compatible).
 * To call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a cluster instance.
 * *   The instance is deployed in classic mode.
 * *   The instance is deployed in a virtual private cloud (VPC). If the instance is deployed in the classic network, you can call the [SwitchNetwork](https://help.aliyun.com/document_detail/473797.html) operation to change the network type to VPC.
 * *   SSL encryption is disabled for the instance. If SSL encryption is enabled, you can call the [ModifyInstanceSSL](https://help.aliyun.com/document_detail/473838.html) operation to disable SSL encryption.
 *
 * @param request AllocateDirectConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateDirectConnectionResponse
 */
async function allocateDirectConnectionWithOptions(request: AllocateDirectConnectionRequest, runtime: $RuntimeOptions): AllocateDirectConnectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.port)) {
    query['Port'] = request.port;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AllocateDirectConnection',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Applies for a private endpoint for a Tair (Redis OSS-compatible) instance.
 *
 * @description Clients can bypass proxy nodes and use private endpoints to connect to cluster instances. This is similar to the connection to native Redis clusters. The direct connection mode can reduce communication overheads and the response time of Tair (Redis OSS-compatible).
 * To call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a cluster instance.
 * *   The instance is deployed in classic mode.
 * *   The instance is deployed in a virtual private cloud (VPC). If the instance is deployed in the classic network, you can call the [SwitchNetwork](https://help.aliyun.com/document_detail/473797.html) operation to change the network type to VPC.
 * *   SSL encryption is disabled for the instance. If SSL encryption is enabled, you can call the [ModifyInstanceSSL](https://help.aliyun.com/document_detail/473838.html) operation to disable SSL encryption.
 *
 * @param request AllocateDirectConnectionRequest
 * @return AllocateDirectConnectionResponse
 */
async function allocateDirectConnection(request: AllocateDirectConnectionRequest): AllocateDirectConnectionResponse {
  var runtime = new $RuntimeOptions{};
  return allocateDirectConnectionWithOptions(request, runtime);
}

model AllocateInstancePublicConnectionRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the public endpoint. The prefix must start with a lowercase letter and can contain lowercase letters and digits. The prefix can be 8 to 40 characters in length.

>  The endpoint is in the `<prefix>.redis.rds.aliyuncs.com` format.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  port?: string(name='Port', description='The service port number of the instance. Valid values: **1024** to **65535**.

This parameter is required.', example='6379'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model AllocateInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='20C8341E-B5AD-4B24-BD82-D73241522ABF'),
}

model AllocateInstancePublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateInstancePublicConnectionResponseBody(name='body'),
}

/**
 * @summary Applies for a public endpoint for an ApsaraDB for Redis instance.
 *
 * @description You can also apply for public endpoints in the ApsaraDB for Redis console. For more information, see [Use a public endpoint to connect to an ApsaraDB for Redis instance](https://help.aliyun.com/document_detail/43850.html).
 *
 * @param request AllocateInstancePublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateInstancePublicConnectionResponse
 */
async function allocateInstancePublicConnectionWithOptions(request: AllocateInstancePublicConnectionRequest, runtime: $RuntimeOptions): AllocateInstancePublicConnectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.port)) {
    query['Port'] = request.port;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AllocateInstancePublicConnection',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Applies for a public endpoint for an ApsaraDB for Redis instance.
 *
 * @description You can also apply for public endpoints in the ApsaraDB for Redis console. For more information, see [Use a public endpoint to connect to an ApsaraDB for Redis instance](https://help.aliyun.com/document_detail/43850.html).
 *
 * @param request AllocateInstancePublicConnectionRequest
 * @return AllocateInstancePublicConnectionResponse
 */
async function allocateInstancePublicConnection(request: AllocateInstancePublicConnectionRequest): AllocateInstancePublicConnectionResponse {
  var runtime = new $RuntimeOptions{};
  return allocateInstancePublicConnectionWithOptions(request, runtime);
}

model CancelActiveOperationTasksRequest {
  ids?: string(name='Ids', description='The IDs of O\\\\&M events that you want to cancel at a time. Separate multiple IDs with commas (,).

This parameter is required.', example='1508850,1508310,1507849,1506274,1505811'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CancelActiveOperationTasksResponseBody = {
  ids?: string(name='Ids', description='The IDs of O\\\\&M events that are canceled at a time. Separate multiple IDs with commas (,).', example='1508850,1508310,1507849,1506274'),
  requestId?: string(name='RequestId', description='The request ID.', example='F16A51B0-436E-5B84-8326-A18AA150D1C4'),
}

model CancelActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Cancels O\\\\\\&M events at a time.
 *
 * @description O\\&M events cannot be canceled in the following scenarios:
 * *   The allowCancel parameter is set to 0.
 * *   The current time is later than the start time of the O\\&M event.
 * *   The state value of the O\\&M event is not 3.
 *
 * @param request CancelActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelActiveOperationTasksResponse
 */
async function cancelActiveOperationTasksWithOptions(request: CancelActiveOperationTasksRequest, runtime: $RuntimeOptions): CancelActiveOperationTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelActiveOperationTasks',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Cancels O\\\\\\&M events at a time.
 *
 * @description O\\&M events cannot be canceled in the following scenarios:
 * *   The allowCancel parameter is set to 0.
 * *   The current time is later than the start time of the O\\&M event.
 * *   The state value of the O\\&M event is not 3.
 *
 * @param request CancelActiveOperationTasksRequest
 * @return CancelActiveOperationTasksResponse
 */
async function cancelActiveOperationTasks(request: CancelActiveOperationTasksRequest): CancelActiveOperationTasksResponse {
  var runtime = new $RuntimeOptions{};
  return cancelActiveOperationTasksWithOptions(request, runtime);
}

model CheckCloudResourceAuthorizedRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleArn?: string(name='RoleArn', description='The Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role that you want to attach to your Tair (Redis OSS-compatible) instance. The ARN must be in the format of `acs:ram::$accountID:role/$roleName`. After the role is attached, your Tair (Redis OSS-compatible) instance can use KMS.

> 

*   `$accountID`: the ID of the Alibaba Cloud account. To view the account ID, log on to the Alibaba Cloud console, move the pointer over your profile picture in the upper-right corner of the page, and then click **Security Settings**.

*   `$roleName`: the name of the RAM role. Replace $roleName with **AliyunRdsInstanceEncryptionDefaultRole**.', example='acs:ram::123456789012****:role/AliyunRdsInstanceEncryptionDefaultRole'),
  securityToken?: string(name='SecurityToken'),
}

model CheckCloudResourceAuthorizedResponseBody = {
  authorizationState?: int32(name='AuthorizationState', description='Indicates whether the instance is authorized to use KMS. Valid values:

*   **0**: The instance is authorized to use KMS.
*   **1**: The instance is not authorized to use KMS.
*   **2**: KMS is not activated. For more information, see [Activate KMS](https://help.aliyun.com/document_detail/153781.html).', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A501A191-BD70-5E50-98A9-C2A486A82****'),
}

model CheckCloudResourceAuthorizedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckCloudResourceAuthorizedResponseBody(name='body'),
}

/**
 * @summary Queries whether a Tair (Redis OSS-compatible) instance has the permissions to use Key Management Service (KMS).
 *
 * @description *   For information about Transparent Data Encryption (TDE) and the usage notes of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 * *   If the Tair (Redis OSS-compatible) instance is authorized to use KMS, you can call the [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html) operation to enable TDE.
 *
 * @param request CheckCloudResourceAuthorizedRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckCloudResourceAuthorizedResponse
 */
async function checkCloudResourceAuthorizedWithOptions(request: CheckCloudResourceAuthorizedRequest, runtime: $RuntimeOptions): CheckCloudResourceAuthorizedResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.roleArn)) {
    query['RoleArn'] = request.roleArn;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckCloudResourceAuthorized',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether a Tair (Redis OSS-compatible) instance has the permissions to use Key Management Service (KMS).
 *
 * @description *   For information about Transparent Data Encryption (TDE) and the usage notes of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 * *   If the Tair (Redis OSS-compatible) instance is authorized to use KMS, you can call the [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html) operation to enable TDE.
 *
 * @param request CheckCloudResourceAuthorizedRequest
 * @return CheckCloudResourceAuthorizedResponse
 */
async function checkCloudResourceAuthorized(request: CheckCloudResourceAuthorizedRequest): CheckCloudResourceAuthorizedResponse {
  var runtime = new $RuntimeOptions{};
  return checkCloudResourceAuthorizedWithOptions(request, runtime);
}

model CreateAccountRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the account.

*   The description must start with a letter, and cannot start with `http://` or `https://`.
*   The description can contain letters, digits, underscores (_), and hyphens (-).
*   The description must be 2 to 256 characters in length.', example='testaccount'),
  accountName?: string(name='AccountName', description='The name of the account. The name must meet the following requirements:

*   The name can contain lowercase letters, digits, and hyphens (-), and must start with a lowercase letter.
*   The name can be up to 100 characters in length.
*   The name cannot be one of the reserved words in the [Reserved words for Redis account names](https://help.aliyun.com/document_detail/92665.html#title-84o-mok-b6h) section.

This parameter is required.', example='demoaccount'),
  accountPassword?: string(name='AccountPassword', description='The password of the account. The password must be 8 to 32 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters. These special characters include `! @ # $ % ^ & * ( ) _ + - =`

This parameter is required.', example='uWonno21****'),
  accountPrivilege?: string(name='AccountPrivilege', description='The permissions of the account. Valid values:

*   **RoleReadOnly**: The account has read-only permissions.
*   **RoleReadWrite**: The account has read and write permissions.', example='RoleReadOnly'),
  accountType?: string(name='AccountType', description='The type of the account. Set the value to **Normal**, which indicates that the account is a standard account.', example='Normal'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
}

model CreateAccountResponseBody = {
  acountName?: string(name='AcountName', description='The name of the account.', example='demoaccount'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ABAF95F6-35C1-4177-AF3A-70969EBD****'),
}

model CreateAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAccountResponseBody(name='body'),
}

/**
 * @summary Creates an account that has specific permissions for a Tair (Redis OSS-compatible) instance.
 *
 * @description *   This operation is supported only for instances that are compatible with Redis 4.0 or later.
 * *   The instance must be in the running state.
 * *   You can create up to 18 accounts for an instance.
 * >  For more information about how to create an account in the console, see [Manage database accounts](https://help.aliyun.com/document_detail/92665.html).
 *
 * @param request CreateAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAccountResponse
 */
async function createAccountWithOptions(request: CreateAccountRequest, runtime: $RuntimeOptions): CreateAccountResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!$isNull(request.accountPrivilege)) {
    query['AccountPrivilege'] = request.accountPrivilege;
  }
  if (!$isNull(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAccount',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates an account that has specific permissions for a Tair (Redis OSS-compatible) instance.
 *
 * @description *   This operation is supported only for instances that are compatible with Redis 4.0 or later.
 * *   The instance must be in the running state.
 * *   You can create up to 18 accounts for an instance.
 * >  For more information about how to create an account in the console, see [Manage database accounts](https://help.aliyun.com/document_detail/92665.html).
 *
 * @param request CreateAccountRequest
 * @return CreateAccountResponse
 */
async function createAccount(request: CreateAccountRequest): CreateAccountResponse {
  var runtime = new $RuntimeOptions{};
  return createAccountWithOptions(request, runtime);
}

model CreateBackupRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CreateBackupResponseBody = {
  backupJobID?: string(name='BackupJobID', description='The ID of the backup task.', example='1162****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2FF6158E-3394-4A90-B634-79C49184****'),
}

model CreateBackupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBackupResponseBody(name='body'),
}

/**
 * @summary Backs up a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also back up an instance in the Tair (Redis OSS-compatible) console. For more information, see [Backup and recovery](https://help.aliyun.com/document_detail/43886.html).
 *
 * @param request CreateBackupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBackupResponse
 */
async function createBackupWithOptions(request: CreateBackupRequest, runtime: $RuntimeOptions): CreateBackupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateBackup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Backs up a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also back up an instance in the Tair (Redis OSS-compatible) console. For more information, see [Backup and recovery](https://help.aliyun.com/document_detail/43886.html).
 *
 * @param request CreateBackupRequest
 * @return CreateBackupResponse
 */
async function createBackup(request: CreateBackupRequest): CreateBackupResponse {
  var runtime = new $RuntimeOptions{};
  return createBackupWithOptions(request, runtime);
}

model CreateCacheAnalysisTaskRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CreateCacheAnalysisTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='BBC1E3D6-7C88-4DF5-9A3D-0DB1E6D9****'),
}

model CreateCacheAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCacheAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary Creates a cache analysis task.
 *
 * @description This operation is no longer available. Use the new operation. For more information, see [Real-time key statistics and offline key analysis](https://help.aliyun.com/document_detail/184226.html).
 *
 * @param request CreateCacheAnalysisTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCacheAnalysisTaskResponse
 */
async function createCacheAnalysisTaskWithOptions(request: CreateCacheAnalysisTaskRequest, runtime: $RuntimeOptions): CreateCacheAnalysisTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCacheAnalysisTask',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a cache analysis task.
 *
 * @description This operation is no longer available. Use the new operation. For more information, see [Real-time key statistics and offline key analysis](https://help.aliyun.com/document_detail/184226.html).
 *
 * @param request CreateCacheAnalysisTaskRequest
 * @return CreateCacheAnalysisTaskResponse
 */
async function createCacheAnalysisTask(request: CreateCacheAnalysisTaskRequest): CreateCacheAnalysisTaskResponse {
  var runtime = new $RuntimeOptions{};
  return createCacheAnalysisTaskWithOptions(request, runtime);
}

model CreateGlobalDistributeCacheRequest {
  effectiveTime?: string(name='EffectiveTime', description='The time when you want to perform the conversion. Valid values:

*   **Immediately**: immediately performs the conversion.
*   **MaintainTime** (default): performs the conversion during the maintenance window.

>  You can call the [ModifyInstanceMaintainTime](https://help.aliyun.com/document_detail/473775.html) operation to modify the maintenance window of an instance.', example='Immediately'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.

>  You do not need to specify system parameters.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  seedSubInstanceId?: string(name='SeedSubInstanceId', description='The ID of the existing instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
}

model CreateGlobalDistributeCacheResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E681E498-5A0D-44F2-B1A7-912DC3******'),
}

model CreateGlobalDistributeCacheResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGlobalDistributeCacheResponseBody(name='body'),
}

/**
 * @summary Converts an existing Tair DRAM-based classic instance to the first child instance of a distributed instance.
 *
 * @description You can call this operation to convert an existing instance to the first child instance of a distributed instance. After the instance is converted, the distributed instance is created. Before you call this operation, make sure that the following requirements are met:
 * *   The instance that you want to convert must be a Tair [DRAM-based](https://help.aliyun.com/document_detail/126164.html) instance that uses the classic deployment mode.
 * *   If the existing instance is a cluster instance, the direct connection mode must be disabled for the instance. For more information, see [Release a private endpoint](https://help.aliyun.com/document_detail/150047.html).
 * >  You can also call the [CreateInstance](https://help.aliyun.com/document_detail/473757.html) operation to create an instance that is specified as the first child instance of a distributed instance. After the child instance is created, the distributed instance to which the child instance belongs is created.
 *
 * @param request CreateGlobalDistributeCacheRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGlobalDistributeCacheResponse
 */
async function createGlobalDistributeCacheWithOptions(request: CreateGlobalDistributeCacheRequest, runtime: $RuntimeOptions): CreateGlobalDistributeCacheResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.seedSubInstanceId)) {
    query['SeedSubInstanceId'] = request.seedSubInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateGlobalDistributeCache',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Converts an existing Tair DRAM-based classic instance to the first child instance of a distributed instance.
 *
 * @description You can call this operation to convert an existing instance to the first child instance of a distributed instance. After the instance is converted, the distributed instance is created. Before you call this operation, make sure that the following requirements are met:
 * *   The instance that you want to convert must be a Tair [DRAM-based](https://help.aliyun.com/document_detail/126164.html) instance that uses the classic deployment mode.
 * *   If the existing instance is a cluster instance, the direct connection mode must be disabled for the instance. For more information, see [Release a private endpoint](https://help.aliyun.com/document_detail/150047.html).
 * >  You can also call the [CreateInstance](https://help.aliyun.com/document_detail/473757.html) operation to create an instance that is specified as the first child instance of a distributed instance. After the child instance is created, the distributed instance to which the child instance belongs is created.
 *
 * @param request CreateGlobalDistributeCacheRequest
 * @return CreateGlobalDistributeCacheResponse
 */
async function createGlobalDistributeCache(request: CreateGlobalDistributeCacheRequest): CreateGlobalDistributeCacheResponse {
  var runtime = new $RuntimeOptions{};
  return createGlobalDistributeCacheWithOptions(request, runtime);
}

model CreateGlobalSecurityIPGroupRequest {
  GIpList?: string(name='GIpList', description='The IP addresses in the IP whitelist template.

>  Separate multiple IP addresses with commas (,). The maximum number of IP addresses is 1,000.

This parameter is required.', example='111.175.56.206,47.253.88.168,111.181.0.162'),
  globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template. The name must meet the following requirements:

*   The name can contain lowercase letters, digits, and underscores (_).
*   The name must start with a letter and end with a letter or digit.
*   The name must be 2 to 120 characters in length.

This parameter is required.', example='test_123'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CreateGlobalSecurityIPGroupResponseBody = {
  globalSecurityIPGroup?: [ 
    {
      GIpList?: string(name='GIpList', description='The IP addresses in the IP whitelist template.', example='192.168.0.1'),
      globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template.', example='white_list_test_sg'),
      globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-sdgwqyp4f5j1x3qk7yvm'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    }
  ](name='GlobalSecurityIPGroup', description='The information about the global IP whitelist template.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model CreateGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Creates a global IP whitelist template.
 *
 * @param request CreateGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGlobalSecurityIPGroupResponse
 */
async function createGlobalSecurityIPGroupWithOptions(request: CreateGlobalSecurityIPGroupRequest, runtime: $RuntimeOptions): CreateGlobalSecurityIPGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.GIpList)) {
    query['GIpList'] = request.GIpList;
  }
  if (!$isNull(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateGlobalSecurityIPGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a global IP whitelist template.
 *
 * @param request CreateGlobalSecurityIPGroupRequest
 * @return CreateGlobalSecurityIPGroupResponse
 */
async function createGlobalSecurityIPGroup(request: CreateGlobalSecurityIPGroupRequest): CreateGlobalSecurityIPGroupResponse {
  var runtime = new $RuntimeOptions{};
  return createGlobalSecurityIPGroupWithOptions(request, runtime);
}

model CreateInstanceRequest {
  appendonly?: string(name='Appendonly', description='Specifies whether to enable append-only file (AOF) persistence for the instance. Valid values:

*   **yes** (default): enables AOF persistence.
*   **no**: disables AOF persistence.

**

**Description** This parameter is applicable to classic instances, and is unavailable for cloud-native instances.', example='yes'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Valid values:

*   **true**: enables auto-renewal.
*   **false** (default): disables auto-renewal.', example='true'),
  autoRenewPeriod?: string(name='AutoRenewPeriod', description='The subscription duration that is supported by auto-renewal. Unit: month. Valid values: **1**, **2**, **3**, **6**, and **12**.

>  This parameter is required if the **AutoRenew** parameter is set to **true**.', example='3'),
  autoUseCoupon?: string(name='AutoUseCoupon', description='Specifies whether to use a coupon. Valid values:

*   **true**: uses a coupon.
*   **false** (default): does not use a coupon.', example='false'),
  backupId?: string(name='BackupId', description='If your instance is a cloud-native cluster instance, we recommend that you use [DescribeClusterBackupList](https://help.aliyun.com/document_detail/2679168.html) to query the backup set ID of the cluster instance, such as cb-xx. Then, set the ClusterBackupId request parameter to the backup set ID to clone the cluster instance. This eliminates the need to specify the backup set ID of each shard.

You can set the BackupId parameter to the backup set ID of the source instance. The system uses the data stored in the backup set to create an instance. You can call the [DescribeBackups](https://help.aliyun.com/document_detail/473823.html) operation to query backup set IDs. If the source instance is a cluster instance, set the BackupId parameter to the backup set IDs of all shards of the source instance, separated by commas (,). Example: "10\\\\*\\\\*,11\\\\*\\\\*,15\\\\*\\\\*".', example='111111111'),
  businessInfo?: string(name='BusinessInfo', description='The ID of the promotional event or business information.', example='000000000'),
  capacity?: long(name='Capacity', description='The storage capacity of the instance. Unit: MB.

> You must specify at least one of the **Capacity** and **InstanceClass** parameters when you call this operation.', example='16384'),
  chargeType?: string(name='ChargeType', description='The billing method. Valid values:

*   **PrePaid**: subscription
*   **PostPaid** (default): pay-as-you-go', example='PostPaid'),
  clusterBackupId?: string(name='ClusterBackupId', description='This parameter is supported for specific new cluster instances. You can query the backup set ID by using the [DescribeClusterBackupList](https://help.aliyun.com/document_detail/2679168.html) operation.

*   If this parameter is supported, you can specify the backup set ID. In this case, you do not need to specify the **BackupId** parameter.
*   If this parameter is not supported, set the BackupId parameter to the IDs of backup sets for all shards of the source instance, separated by commas (,). Example: "2158\\\\*\\\\*\\\\*\\\\*20,2158\\\\*\\\\*\\\\*\\\\*22".', example='cb-hyxdof5x9kqbtust'),
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The operation that you want to perform. Set the value to **AllocateInstancePublicConnection**.', example='r-bp1zxszhcgatnx****'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `default`.', example='youhuiquan_promotion_option_id_for_blank'),
  dedicatedHostGroupId?: string(name='DedicatedHostGroupId', description='The ID of the dedicated cluster. This parameter is required if you create an instance in a dedicated cluster.', example='dhg-uv4fnk6r7zff****'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: performs a dry run and does not create the instance. The system prechecks the request parameters, request format, service limits, and available resources. If the request fails the dry run, an error code is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false**: performs a dry run and sends the request. If the request passes the dry run, the instance is created.', example='false'),
  engineVersion?: string(name='EngineVersion', description='The engine version. Valid values for **classic instances**:

*   **2.8** (not recommended due to [scheduled EOFS](https://help.aliyun.com/document_detail/2674657.html))
*   **4.0** (not recommended)
*   **5.0**

Valid values for **cloud-native instances**:

*   **5.0**
*   **6.0** (recommended)
*   **7.0**

>  The default value is **5.0**.', example='4.0'),
  globalInstance?: boolean(name='GlobalInstance', description='Specifies whether to use the new instance as the first child instance of a distributed instance. Valid values:

*   **true**: uses the new instance as the first child instance.
*   **false** (default): does not use the new instance as the first child instance.

> *   If you want to create a Tair DRAM-based instance that runs Redis 5.0, you must set this parameter to **true**.
> *   This parameter is available only on the China site (aliyun.com).', example='false'),
  globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance. This parameter is available only on the China site (aliyun.com).', example='gr-bp14rkqrhac****'),
  globalSecurityGroupIds?: string(name='GlobalSecurityGroupIds', description='The global IP whitelist template for the instance. Multiple IP whitelist templates should be separated by English commas (,) and cannot be duplicated.', example='g-zsldxfiwjmti0kcm****'),
  instanceClass?: string(name='InstanceClass', description='The instance type. For example, redis.master.small.default indicates a Community Edition standard master-replica instance that has 1 GB of memory. For more information, see [Overview](https://help.aliyun.com/document_detail/26350.html).

**

**Description** You must specify at least one of the **Capacity** and **InstanceClass** parameters when you call the CreateInstance operation.', example='redis.master.small.default'),
  instanceName?: string(name='InstanceName', description='The name of the instance. The name must be 2 to 80 characters in length and must start with a letter. It cannot contain spaces or specific special characters. These special characters include `@ / : = " < > { [ ] }`', example='apitest'),
  instanceType?: string(name='InstanceType', description='The database engine of the instance. Valid values:

*   **Redis** (default)
*   **Memcache**', example='Redis'),
  networkType?: string(name='NetworkType', description='The network type. Valid values:

*   **VPC** (default)', example='VPC'),
  nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **MASTER_SLAVE**: high availability (master-replica)
*   **STAND_ALONE**: standalone
*   **double**: master-replica
*   **single**: standalone

>  To create a cloud-native instance, set this parameter to **MASTER_SLAVE** or **STAND_ALONE**. To create a classic instance, set this parameter to **double** or **single**.', example='STAND_ALONE'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  paramGroupId?: string(name='ParamGroupId', description='The parameter template ID, which must be globally unique.', example='rpg-test**'),
  password?: string(name='Password', description='The password that is used to connect to the instance. The password must be 8 to 32 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters. These special characters include `! @ # $ % ^ & * ( ) _ + - =`', example='Pass!123456'),
  period?: string(name='Period', description='The subscription duration. Valid values: **1**, 2, 3, 4, 5, 6, 7, 8, **9**, **12**, **24**,**36**, and **60**. Unit: months.

> This parameter is available and required only if the **ChargeType** parameter is set to **PrePaid**.', example='12'),
  port?: string(name='Port', description='The port number that is used to connect to the instance. Valid values: **1024** to **65535**. Default value: **6379**.', example='6379'),
  privateIpAddress?: string(name='PrivateIpAddress', description='The private IP address of the instance.

> The private IP address must be available within the CIDR block of the vSwitch to which to connect the instance.', example='172.16.0.***'),
  readOnlyCount?: int32(name='ReadOnlyCount', description='The number of read replicas in the primary zone. This parameter applies only to read/write splitting instances that use cloud disks. You can use this parameter to customize the number of read replicas. Valid values: 1 to 9.

>  The sum of the values of this parameter and SlaveReadOnlyCount cannot be greater than 9.', example='5'),
  recoverConfigMode?: string(name='RecoverConfigMode', description='When creating an instance using a specified backup set, whether to restore account, kernel parameter (whitelist), and whitelist (config) information from the original backup set. For example, if you need to restore account information, the value should be `{"account":true}`.
By default, it is empty, indicating that no account, kernel parameter, or whitelist information will be restored from the original backup set. 
> This parameter applies only to cloud-native instances and requires that the original backup set has saved the account, kernel parameter, and whitelist information. You can use the [DescribeBackups](https://help.aliyun.com/document_detail/473823.html) API to check if the RecoverConfigMode parameter in the specified backup set contains the above information.', example='{"whitelist":true,"config":true,"account":true}'),
  regionId?: string(name='RegionId', description='The ID of the region where you want to create the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  replicaCount?: int32(name='ReplicaCount', description='The number of slave replicas in the primary availability zone. This parameter is applicable only for creating cloud-native cluster edition multi-replica instances, allowing you to customize the number of slave replicas. The value range is 1 to 4.
> > - The sum of this parameter and SlaveReplicaCount cannot exceed 4. 
>> - Only one of this parameter and ReadOnlyCount can be passed; there are no instances that simultaneously include both replicas and read-only nodes. 
>> - Primary-secondary instances do not support multiple replicas.', example='2'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-resourcegroupid1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='If data flashback is enabled for the source instance, you can use this parameter to specify a point in time within the backup retention period of the source instance. The system uses the backup data of the source instance at the point in time to create an instance. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2019-06-19T16:00:00Z'),
  secondaryZoneId?: string(name='SecondaryZoneId', description='The secondary zone ID of the instance. You can call the [DescribeZones](https://help.aliyun.com/document_detail/473764.html) operation to query the most recent zone list.

> If you specify this parameter, the master node and replica node of the instance can be deployed in different zones and disaster recovery is implemented across zones. The instance can withstand failures in data centers.', example='cn-hangzhou-h'),
  securityToken?: string(name='SecurityToken', description='系统自动生成的安全 Token，无需传入'),
  shardCount?: int32(name='ShardCount', description='The number of shards. This parameter is applicable only to cloud-native cluster instances. You can use this parameter to customize the number of shards.', example='4'),
  slaveReadOnlyCount?: int32(name='SlaveReadOnlyCount', description='The number of read replicas in the secondary zone. This parameter is used to create a read/write splitting instance that is deployed across multiple zones. The sum of the values of this parameter and ReadOnlyCount cannot be greater than 9.

> When you create a multi-zone read/write splitting instance, you must specify both SlaveReadOnlyCount and SecondaryZoneId.', example='2'),
  slaveReplicaCount?: int32(name='SlaveReplicaCount', description='Used for specifying the number of slave replicas in the secondary availability zone when creating a multi-AZ cloud-native cluster edition with multiple replicas. The sum of this parameter and ReplicaCount cannot exceed 4. <notice>When creating a multi-AZ cloud-native cluster edition with multiple replicas, both SlaveReplicaCount and SecondaryZoneId parameters must be specified.</notice>', example='2'),
  srcDBInstanceId?: string(name='SrcDBInstanceId', description='If you want to create an instance based on the backup set of an existing instance, set this parameter to the ID of the source instance.

>  After you specify the SrcDBInstanceId parameter, use the **BackupId**, **ClusterBackupId** (recommended for cloud-native cluster instances), or **RestoreTime** parameter to specify the backup set or the specific point in time that you want to use to create an instance. The SrcDBInstanceId parameter must be used in combination with one of the preceding three parameters.', example='r-bp1zxszhcgatnx****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The keys of the tags that are added to the instance.

> *   **N** specifies the serial number of the tag. Up to 20 tags can be added to a single instance. For example, Tag.1.Key specifies the key of the first tag and Tag.2.Key specifies the key of the second tag.
> *   If the key of the tag does not exist, the tag is automatically created.', example='testkey'),
      value?: string(name='Value', description='The values of the tags that are added to the instance.

> **N** specifies the serial number of the tag. For example, **Tag.1.Value** specifies the value of the first tag and **Tag.2.Value** specifies the value of the second tag.', example='testvalue'),
    }
  ](name='Tag', description='The tags of the instance.'),
  token?: string(name='Token', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the token is unique among different requests. The token is case-sensitive. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch to which you want the instance to connect.', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', description='The primary zone ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent zone list.', example='cn-hangzhou-e'),
}

model CreateInstanceResponseBody = {
  bandwidth?: long(name='Bandwidth', description='The maximum bandwidth of the instance. Unit: MB/s.', example='32'),
  capacity?: long(name='Capacity', description='The storage capacity of the instance. Unit: MB.', example='16384'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
  config?: string(name='Config', description='The configurations of the instance.', example='{\\\\"EvictionPolicy\\\\":\\\\"volatile-lru\\\\",\\\\"hash-max-ziplist-entries\\\\":512,\\\\"zset-max-ziplist-entries\\\\":128,\\\\"zset-max-ziplist-value\\\\":64,\\\\"set-max-intset-entries\\\\":512,\\\\"hash-max-ziplist-value\\\\":64}'),
  connectionDomain?: string(name='ConnectionDomain', description='The internal endpoint of the instance.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
  connections?: long(name='Connections', description='The maximum number of connections supported by the instance.', example='10000'),
  endTime?: string(name='EndTime', description='The time when the subscription expires. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-18T16:00:00Z'),
  instanceId?: string(name='InstanceId', description='The GUID of the instance.', example='r-bp1zxszhcgatnx****'),
  instanceName?: string(name='InstanceName', description='The name of the instance.', example='apitest'),
  instanceStatus?: string(name='InstanceStatus', description='The state of the instance. The return value is Creating.', example='Creating'),
  networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **CLASSIC**: classic network
*   **VPC**: VPC', example='VPC'),
  nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **STAND_ALONE**: standalone
*   **MASTER_SLAVE**: master-replica', example='MASTER_SLAVE'),
  orderId?: long(name='OrderId', description='The ID of the order.

This parameter is required.', example='2084452111111'),
  port?: int32(name='Port', description='The port number that is used to connect to the instance.', example='6379'),
  privateIpAddr?: string(name='PrivateIpAddr', description='The private IP address of the instance.', example='172.16.0.10'),
  QPS?: long(name='QPS', description='The expected maximum queries per second (QPS).', example='100000'),
  regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hongkong'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5DEA3CC9-F81D-4387-8E97-CEA40F09****'),
  userName?: string(name='UserName', description='The username that is used to connect to the instance. By default, Tair (Redis OSS-compatible) provides a username that is named after the instance ID.', example='r-bp1zxszhcgatnx****'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch to which the instance is connected.', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hangzhou-b'),
}

model CreateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResponseBody(name='body'),
}

/**
 * @summary Creates a Tair (Redis OSS-compatible) instance. If you want to create a Tair (Enterprise Edition) cloud-native instance, you can call the CreateTairInstance operation.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of Tair (Redis OSS-compatible).
 * You can call this operation to create a Tair (Redis OSS-compatible) instance or a classic Tair DRAM-based instance. To create a cloud-native Tair instance, call the [CreateTairInstance](https://help.aliyun.com/document_detail/473770.html) operation.
 * > For more information about how to create an instance that meets your requirements in the Tair (Redis OSS-compatible) console, see [Step 1: Create an instance](https://help.aliyun.com/document_detail/26351.html).
 *
 * @param request CreateInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceResponse
 */
async function createInstanceWithOptions(request: CreateInstanceRequest, runtime: $RuntimeOptions): CreateInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appendonly)) {
    query['Appendonly'] = request.appendonly;
  }
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.autoRenewPeriod)) {
    query['AutoRenewPeriod'] = request.autoRenewPeriod;
  }
  if (!$isNull(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.capacity)) {
    query['Capacity'] = request.capacity;
  }
  if (!$isNull(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!$isNull(request.clusterBackupId)) {
    query['ClusterBackupId'] = request.clusterBackupId;
  }
  if (!$isNull(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.dedicatedHostGroupId)) {
    query['DedicatedHostGroupId'] = request.dedicatedHostGroupId;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.globalInstance)) {
    query['GlobalInstance'] = request.globalInstance;
  }
  if (!$isNull(request.globalInstanceId)) {
    query['GlobalInstanceId'] = request.globalInstanceId;
  }
  if (!$isNull(request.globalSecurityGroupIds)) {
    query['GlobalSecurityGroupIds'] = request.globalSecurityGroupIds;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!$isNull(request.nodeType)) {
    query['NodeType'] = request.nodeType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.paramGroupId)) {
    query['ParamGroupId'] = request.paramGroupId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.port)) {
    query['Port'] = request.port;
  }
  if (!$isNull(request.privateIpAddress)) {
    query['PrivateIpAddress'] = request.privateIpAddress;
  }
  if (!$isNull(request.readOnlyCount)) {
    query['ReadOnlyCount'] = request.readOnlyCount;
  }
  if (!$isNull(request.recoverConfigMode)) {
    query['RecoverConfigMode'] = request.recoverConfigMode;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.replicaCount)) {
    query['ReplicaCount'] = request.replicaCount;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!$isNull(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.shardCount)) {
    query['ShardCount'] = request.shardCount;
  }
  if (!$isNull(request.slaveReadOnlyCount)) {
    query['SlaveReadOnlyCount'] = request.slaveReadOnlyCount;
  }
  if (!$isNull(request.slaveReplicaCount)) {
    query['SlaveReplicaCount'] = request.slaveReplicaCount;
  }
  if (!$isNull(request.srcDBInstanceId)) {
    query['SrcDBInstanceId'] = request.srcDBInstanceId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.token)) {
    query['Token'] = request.token;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a Tair (Redis OSS-compatible) instance. If you want to create a Tair (Enterprise Edition) cloud-native instance, you can call the CreateTairInstance operation.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of Tair (Redis OSS-compatible).
 * You can call this operation to create a Tair (Redis OSS-compatible) instance or a classic Tair DRAM-based instance. To create a cloud-native Tair instance, call the [CreateTairInstance](https://help.aliyun.com/document_detail/473770.html) operation.
 * > For more information about how to create an instance that meets your requirements in the Tair (Redis OSS-compatible) console, see [Step 1: Create an instance](https://help.aliyun.com/document_detail/26351.html).
 *
 * @param request CreateInstanceRequest
 * @return CreateInstanceResponse
 */
async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return createInstanceWithOptions(request, runtime);
}

model CreateInstancesRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true** (default).
*   **false**. If automatic payment is disabled, you must perform the following steps to complete the payment in the Tair (Redis OSS-compatible) console: In the top navigation bar, choose **Expenses** > **Renewal Management**. In the left-side navigation pane, click **Orders**. On the **Orders** page, find the order and complete the payment.

>  This parameter is valid only if the value of the **ChargeType** field in the **Instances** parameter is set to **PrePaid**.', example='true'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:

*   **true**: yes
*   **false**: no

>  This parameter is available only if **ChargeType** in the **Instances** parameter is set to **PrePaid**.', example='false'),
  businessInfo?: string(name='BusinessInfo', description='The additional business information about the instance.', example='000000000'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values: **4.0** and **5.0**.

>  The default value is **5.0**.

Valid values:

*   2.8
*   4.0
*   5.0', example='5.0'),
  instances?: string(name='Instances', description='The JSON-formatted configurations of the instance. For more information, see the "Additional description of the Instances parameter" section.

This parameter is required.', example='[{	"RegionId": "cn-hangzhou",	"izNo": "cn-hangzhou-b",	"quantity": 2,	"instanceType": "Redis",	"instanceClass": "redis.master.small.default",	"EngineVersion": "5.0",	"ChargeType": "PostPaid"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  rebuildInstance?: boolean(name='RebuildInstance', description='Specifies whether to restore the source instance from the recycle bin. Valid values:

*   **true**
*   **false** (default)

>  This parameter is valid only if the **SrcDBInstanceId** field in the **Instances** parameter is specified.', example='false'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which to assign the instance.', example='rg-resourcegroupid1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  token?: string(name='Token', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token is case-sensitive. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
}

model CreateInstancesResponseBody = {
  instanceIds?: {
    instanceId?: [ string ](name='InstanceId')
  }(name='InstanceIds', description='The IDs of instances that were created.'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='20905403119****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='561AFBF1-BE20-44DB-9BD1-6988B53E****'),
}

model CreateInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstancesResponseBody(name='body'),
}

/**
 * @summary Creates multiple Tair (Redis OSS-compatible) instances at a time.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of Tair (Redis OSS-compatible).
 * >  You can call this operation to create classic Redis Open-Source Edition instances or classic Tair DRAM-based instances. We recommend that you use an API operation for creating a single instance:
 * *   [CreateInstance](https://help.aliyun.com/document_detail/473757.html): creates a Redis Open-Source instance or a classic Tair DRAM-based instance.
 * *   [CreateTairInstance](https://help.aliyun.com/document_detail/473770.html): creates a Tair (Enterprise Edition) instance. The instance can be a DRAM-based, persistent memory-optimized, or ESSD/SSD-based instance.
 *
 * @param request CreateInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstancesResponse
 */
async function createInstancesWithOptions(request: CreateInstancesRequest, runtime: $RuntimeOptions): CreateInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.instances)) {
    query['Instances'] = request.instances;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.rebuildInstance)) {
    query['RebuildInstance'] = request.rebuildInstance;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateInstances',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates multiple Tair (Redis OSS-compatible) instances at a time.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of Tair (Redis OSS-compatible).
 * >  You can call this operation to create classic Redis Open-Source Edition instances or classic Tair DRAM-based instances. We recommend that you use an API operation for creating a single instance:
 * *   [CreateInstance](https://help.aliyun.com/document_detail/473757.html): creates a Redis Open-Source instance or a classic Tair DRAM-based instance.
 * *   [CreateTairInstance](https://help.aliyun.com/document_detail/473770.html): creates a Tair (Enterprise Edition) instance. The instance can be a DRAM-based, persistent memory-optimized, or ESSD/SSD-based instance.
 *
 * @param request CreateInstancesRequest
 * @return CreateInstancesResponse
 */
async function createInstances(request: CreateInstancesRequest): CreateInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return createInstancesWithOptions(request, runtime);
}

model CreateParameterGroupRequest {
  category?: string(name='Category', description='The service category. Valid values:

*   **standard**: Community Edition
*   **enterprise**: Enhanced Edition (Tair)

This parameter is required.', example='enterprise'),
  engineType?: string(name='EngineType', description='The engine type. Valid values:

*   **redis**: ApsaraDB for Redis Community Edition instance or Tair DRAM-based instance
*   **tair_pena**: Tair persistent memory-optimized instance
*   **tair_pdb**: Tair ESSD/SSD-based instance

This parameter is required.', example='redis'),
  engineVersion?: string(name='EngineVersion', description='The compatible engine version. Valid values:

*   For ApsaraDB for Redis Community Edition instances, set the parameter to **5.0**, **6.0**, or **7.0**.
*   For Tair DRAM-based instances that are compatible with Redis 5.0, 6.0, or 7.0, set the parameter to **5.0**, **6.0**, or **7.0**.
*   For Tair persistent memory-optimized instances that are compatible with Redis 6.0, set the parameter to **1.0**.
*   For Tair ESSD-based instances that are compatible with Redis 6.0, set the parameter to **1.0**. For Tair SSD-based instances that are compatible with Redis 6.0, set the parameter to **2.0**.

This parameter is required.', example='6.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  parameterGroupDesc?: string(name='ParameterGroupDesc', description='The description of the parameter template. The description must be 0 to 200 characters in length.', example='test'),
  parameterGroupName?: string(name='ParameterGroupName', description='The new name of the parameter template. The name must meet the following requirements:

*   The name can contain letters, digits, and underscores (_). It must start with a letter and cannot contain Chinese characters.
*   The name can be 8 to 64 characters in length.

This parameter is required.', example='tw_test1'),
  parameters?: string(name='Parameters', description='A JSON-formatted object that specifies the parameter-value pairs. Format: {"Parameter 1":"Value 1","Parameter 2":"Value 2"...}. The specified value overwrites the original content.

>  The parameters that can be added for different editions are displayed in the console.

This parameter is required.', example='{"hz":"15","#no_loose_disabled-commands":"flushall"}'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CreateParameterGroupResponseBody = {
  paramGroupId?: string(name='ParamGroupId', description='The parameter template ID.', example='g-51ii2ienn0dg0xi8****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='62DA5BE5-F9C9-527C-ACCB-4D783C297A3A'),
}

model CreateParameterGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateParameterGroupResponseBody(name='body'),
}

/**
 * @summary Creates a parameter template.
 *
 * @param request CreateParameterGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateParameterGroupResponse
 */
async function createParameterGroupWithOptions(request: CreateParameterGroupRequest, runtime: $RuntimeOptions): CreateParameterGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.engineType)) {
    query['EngineType'] = request.engineType;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.parameterGroupDesc)) {
    query['ParameterGroupDesc'] = request.parameterGroupDesc;
  }
  if (!$isNull(request.parameterGroupName)) {
    query['ParameterGroupName'] = request.parameterGroupName;
  }
  if (!$isNull(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateParameterGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a parameter template.
 *
 * @param request CreateParameterGroupRequest
 * @return CreateParameterGroupResponse
 */
async function createParameterGroup(request: CreateParameterGroupRequest): CreateParameterGroupResponse {
  var runtime = new $RuntimeOptions{};
  return createParameterGroupWithOptions(request, runtime);
}

model CreateTCInstanceRequest {
  autoRenew?: string(name='AutoRenew', example='false'),
  autoRenewPeriod?: string(name='AutoRenewPeriod', example='1'),
  autoUseCoupon?: string(name='AutoUseCoupon', example='false'),
  businessInfo?: string(name='BusinessInfo', example='000000000'),
  clientToken?: string(name='ClientToken', example='ETnLKlblzczshOTUbOCz****'),
  couponNo?: string(name='CouponNo', example='youhuiquan_promotion_option_id_for_blank'),
  dataDisk?: [ 
    {
      category?: string(name='Category', description='This parameter is required.', example='cloud_essd'),
      performanceLevel?: string(name='PerformanceLevel', description='This parameter is required.', example='PL0'),
      size?: int32(name='Size', description='This parameter is required.', example='100'),
    }
  ](name='DataDisk', description='This parameter is required.'),
  dryRun?: boolean(name='DryRun', example='false'),
  imageId?: string(name='ImageId', description='This parameter is required.', example='ubuntu_20_04_64_20G_alibase_20210412'),
  instanceChargeType?: string(name='InstanceChargeType', example='PrePaid'),
  instanceClass?: string(name='InstanceClass', example='tair.kvcache.guis.8.gu60'),
  instanceName?: string(name='InstanceName', example='newinstancename'),
  needEni?: boolean(name='NeedEni'),
  networkType?: string(name='NetworkType', example='VPC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: string(name='Period', example='12'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyiu4e******'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityGroupId?: string(name='SecurityGroupId', example='sg-bpcfmyiu4ekp****'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key', example='key1_test'),
      value?: string(name='Value', example='testvalue'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', example='cn-hangzhou-b'),
}

model CreateTCInstanceResponseBody = {
  instanceId?: string(name='InstanceId', example='tc-bp1zxszhcgatnx****'),
  orderId?: long(name='OrderId', description='This parameter is required.', example='22179******0904'),
  requestId?: string(name='RequestId', example='561AFBF1-BE20-44DB-9BD1-6988B53E****'),
}

model CreateTCInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTCInstanceResponseBody(name='body'),
}

/**
 * @summary 创建TairCustom实例
 *
 * @param request CreateTCInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTCInstanceResponse
 */
async function createTCInstanceWithOptions(request: CreateTCInstanceRequest, runtime: $RuntimeOptions): CreateTCInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.autoRenewPeriod)) {
    query['AutoRenewPeriod'] = request.autoRenewPeriod;
  }
  if (!$isNull(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.dataDisk)) {
    query['DataDisk'] = request.dataDisk;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!$isNull(request.instanceChargeType)) {
    query['InstanceChargeType'] = request.instanceChargeType;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.needEni)) {
    query['NeedEni'] = request.needEni;
  }
  if (!$isNull(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateTCInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建TairCustom实例
 *
 * @param request CreateTCInstanceRequest
 * @return CreateTCInstanceResponse
 */
async function createTCInstance(request: CreateTCInstanceRequest): CreateTCInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return createTCInstanceWithOptions(request, runtime);
}

model CreateTairInstanceRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Set the value to **true**.', example='true'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Valid values:

*   **true**: enables auto-renewal.
*   **false** (default): disables auto-renewal.', example='true'),
  autoRenewPeriod?: string(name='AutoRenewPeriod', description='The subscription duration that is supported by auto-renewal. Unit: month. Valid values: **1**, **2**, **3**, **6**, and **12**.

>  This parameter is required if the **AutoRenew** parameter is set to **true**.', example='3'),
  autoUseCoupon?: string(name='AutoUseCoupon', description='Specifies whether to use a coupon. Valid values:

*   **true**: uses a coupon.
*   **false** (default): does not use a coupon.', example='true'),
  backupId?: string(name='BackupId', description='You can set the BackupId parameter to the backup set ID of the source instance. The system uses the data stored in the backup set to create an instance. You can call the [DescribeBackups](https://help.aliyun.com/document_detail/473823.html) operation to query the backup set ID. If the source instance is a cluster instance, set the BackupId parameter to the backup set IDs of all shards of the source instance, separated by commas (,). Example: "10\\\\*\\\\*,11\\\\*\\\\*,15\\\\*\\\\*".

>  If your instance is a cloud-native cluster instance, we recommend that you use [DescribeClusterBackupList](https://help.aliyun.com/document_detail/2679168.html) to query the backup set ID of the cluster instance, such as cb-xx. Then, set the ClusterBackupId request parameter to the backup set ID to clone the cluster instance. This eliminates the need to specify the backup set ID of each shard.', example='11111111'),
  businessInfo?: string(name='BusinessInfo', description='The ID of the promotional event or the business information.', example='000000000'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid** (default): subscription
*   **PostPaid**: pay-as-you-go', example='PrePaid'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests and is case-sensitive. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  clusterBackupId?: string(name='ClusterBackupId', description='This parameter is supported for specific new cluster instances. You can query the backup set ID by calling the [DescribeClusterBackupList](https://help.aliyun.com/document_detail/2679168.html) operation.

*   If this parameter is supported, you can specify the backup set ID. In this case, you do not need to specify the **BackupId** parameter.
*   If this parameter is not supported, set the BackupId parameter to the IDs of backup sets in all shards of the source instance, separated by commas (,). Example: "2158\\\\*\\\\*\\\\*\\\\*20,2158\\\\*\\\\*\\\\*\\\\*22".', example='cb-hyxdof5x9kqb****'),
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the endpoint. The prefix must be 8 to 40 characters in length and can contain lowercase letters and digits. It must start with a lowercase letter.

>  The endpoint must be in the \\\\<prefix>.redis.rds.aliyuncs.com format.', example='r-bp1zxszhcgatnx****'),
  couponNo?: string(name='CouponNo', description='The coupon code.', example='youhuiquan_promotion_option_id_for_blank'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs a dry run and does not create the instance. The system prechecks the request parameters, request format, service limits, and available resources. If the request fails the dry run, an error code is returned. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false** (false): performs a dry run and performs the actual request. If the request passes the dry run, the instance is directly created.', example='false'),
  engineVersion?: string(name='EngineVersion', description='The database engine version. Default value: **1.0**. The parameter value varies based on the Tair instance series.

*   To create a Tair DRAM-based instance (Tair_rdb) that is compatible with Redis 5.0, 6.0, or 7.0, set this parameter to **5.0**, **6.0**, or **7.0**.
*   To create a Tair persistent memory-optimized instance (tair_scm) that is compatible with Redis 6.0, set this parameter to **1.0**.
*   To create a Tair ESSD-based instance (tair_essd) that is compatible with Redis 6.0, set this parameter to **1.0**. To create a Tair SSD-based instance that is compatible with Redis 6.0, set this parameter to **2.0**.', example='1.0'),
  globalInstanceId?: string(name='GlobalInstanceId', description='Specifies whether to use the created instance as a child instance of a distributed instance.

*   If you want the created instance to be used as the first child instance, enter **true**.
*   If you want the created instance to be used as the second or third child instance, enter the ID of the distributed instance, such as gr-bp14rkqrhac\\\\*\\\\*\\\\*\\\\*.
*   If you do not want the created instance to be used as a distributed instance, leave the parameter empty.

>  If you want the created instance to be used as a distributed instance, the created instance must be a Tair DRAM-based instance.', example='gr-bp14rkqrhac****'),
  globalSecurityGroupIds?: string(name='GlobalSecurityGroupIds', description='The global IP whitelist templates of the instance. Separate multiple IP whitelist templates with commas (,). Each IP whitelist template must be unique.', example='g-zsldxfiwjmti0kcm****'),
  instanceClass?: string(name='InstanceClass', description='The instance series. For more information, see the following topics:

*   [DRAM-based instances](https://help.aliyun.com/document_detail/2527112.html)
*   [Persistent memory-optimized instances](https://help.aliyun.com/document_detail/2527110.html)
*   [ESSD/SSD-based instances](https://help.aliyun.com/document_detail/2527111.html)

This parameter is required.', example='tair.scm.standard.4m.32d'),
  instanceName?: string(name='InstanceName', description='The name of the instance. The name must meet the following requirements:

*   The name must be 2 to 80 characters in length.
*   The name must start with a letter and cannot contain spaces or special characters. Special characters include `@ / : = " < > { [ ] }`', example='apitest'),
  instanceType?: string(name='InstanceType', description='The instance series. Valid values:

*   **tair_rdb**: Tair DRAM-based instance
*   **tair_scm**: Tair persistent memory-optimized instance
*   **tair_essd**: Tair ESSD/SSD-based instance

This parameter is required.', example='tair_scm'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  paramGroupId?: string(name='ParamGroupId', description='The ID of the parameter template. The instance is created based on the parameters in the parameter template. The ID must be unique.', example='g-50npzjcqb1ua6q6j****'),
  password?: string(name='Password', description='The password that is used to connect to the instance. The password must meet the following requirements:

*   The password must be 8 to 32 characters in length.
*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include `! @ # $ % ^ & * ( ) _ + - =`', example='Pass!123456'),
  period?: int32(name='Period', description='The subscription duration. Valid values: **1**, 2, 3, 4, 5, 6, 7, 8, **9**, **12**, **24**,**36**, and **60**. Unit: month.

>  This parameter is required only if the **ChargeType** parameter is set to **PrePaid**.', example='1'),
  port?: int32(name='Port', description='The service port number of the instance. Valid values: 1024 to 65535. Default value: 6379.', example='6379'),
  privateIpAddress?: string(name='PrivateIpAddress', description='The internal IP address of the instance.

>  The IP address must be within the CIDR block of the vSwitch to which you want the instance to connect. You can call the [DescribeVSwitches](https://help.aliyun.com/document_detail/35748.html) operation of VPC to query the CIDR block information.', example='172.16.88.***'),
  readOnlyCount?: int32(name='ReadOnlyCount', description='The number of read replicas in the primary zone. This parameter applies only to cloud-native read/write splitting instances. Valid values: 1 to 9.

>  The sum of the values of this parameter and the SlaveReadOnlyCount parameter cannot exceed 9.', example='5'),
  recoverConfigMode?: string(name='RecoverConfigMode', description='Specifies whether to restore the account, kernel parameter, and whitelist information from the original backup set when you create an instance from the specified backup set. For example, if you want to restore the account information, set the parameter to `{"account":true}`.

This parameter is empty by default, which indicates that the account, kernel parameter, and whitelist information is not restored from the original backup set.

>  This parameter applies only to cloud-native cluster instances. The account, kernel parameter, and whitelist information must be stored in the original backup set. You can call the [DescribeBackups](https://help.aliyun.com/document_detail/473823.html) operation to check whether the RecoverConfigMode configurations in the specified backup set contain the preceding information.', example='{"whitelist":true,"config":true,"account":true}'),
  regionId?: string(name='RegionId', description='The region ID. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  replicaCount?: int32(name='ReplicaCount', description='The number of replica nodes in the primary zone. This parameter applies only to cloud-native multi-replica cluster instances. Valid values: 1 to 4.

> 

*   The sum of the values of this parameter and the SlaveReplicaCount parameter cannot exceed 4.

*   You can specify only one of the ReplicaCount and ReadOnlyCount parameters.

*   Master-replica instances do not support multiple replicas.', example='2'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group that you want to manage.

> 

*   You can query resource group IDs in the console or by calling the [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html) operation. For more information, see [View the basic information about a resource group](https://help.aliyun.com/document_detail/151181.html).

*   Before you modify the resource group to which an instance belongs, you can call the [ListResources](https://help.aliyun.com/document_detail/158866.html) operation to view the current resource group of the instance.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='If data flashback is enabled for the source instance, you can use this parameter to specify a point in time within the backup retention period of the source instance. The system uses the backup data of the source instance at the point in time to create an instance. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2021-07-06T07:25:57Z'),
  secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the secondary zone. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the ID of the secondary zone.

>  You cannot specify multiple zone IDs or set this parameter to a value that is the same as that of the ZoneId parameter.', example='cn-hangzhou-h'),
  securityToken?: string(name='SecurityToken'),
  shardCount?: int32(name='ShardCount', description='The number of data nodes in the instance. Valid values:

*   **1** (default): You can create a [standard instance](https://help.aliyun.com/document_detail/52228.html) that contains only one data node.
*   **2** to **32**: You can create a [cluster instance](https://help.aliyun.com/document_detail/52228.html) that contains the specified number of data nodes.

>  When the **InstanceType** parameter is set to **tair_rdb** or **tair_scm**, this parameter can be set to a value in the range of **2** to **32**. Only DRAM-based and persistent memory-optimized instances support the cluster architecture.', example='1'),
  shardType?: string(name='ShardType', description='The shard type of the instance. Valid values:

*   **MASTER_SLAVE** (default): runs in a master-replica architecture that provides high availability.
*   **STAND_ALONE**: runs in a standalone architecture. If the only node fails, the system creates a new instance and switches the workloads to the new instance. This may cause data loss. You can set the ShardType parameter to this value only if the instance uses the **single-zone** deployment mode. If you set the ShardType parameter to this value, you cannot create cluster or read/write splitting instances.', example='MASTER_SLAVE'),
  slaveReadOnlyCount?: int32(name='SlaveReadOnlyCount', description='The number of read replicas in the secondary zone when you create a multi-zone read/write splitting instance. The sum of the values of this parameter and the ReadOnlyCount parameter cannot exceed 9.

> When you create a multi-zone read/write splitting instance, you must specify both SlaveReadOnlyCount and SecondaryZoneId.', example='1'),
  slaveReplicaCount?: int32(name='SlaveReplicaCount', description='The number of replica nodes in the secondary zone when you create a cloud-native multi-replica cluster instance deployed across multiple zones. The sum of the values of this parameter and the ReplicaCount parameter cannot exceed 4.

>  When you create a cloud-native multi-replica cluster instance deployed across multiple zones, you must specify both SlaveReplicaCount and SecondaryZoneId.', example='2'),
  srcDBInstanceId?: string(name='SrcDBInstanceId', description='If you want to create an instance based on the backup set of an existing instance, set this parameter to the ID of the source instance.

>  After you specify the SrcDBInstanceId parameter, use the **BackupId**, **ClusterBackupId** (recommended for cloud-native cluster instances), or **RestoreTime** parameter to specify the backup set or the specific point in time that you want to use to create an instance. The SrcDBInstanceId parameter must be used in combination with one of the preceding three parameters.', example='r-bp1zxszhcgatnx****'),
  storage?: int32(name='Storage', description='The storage capacity of the ESSD/SSD-based instance. The valid values vary based on the instance type. For more information, see [ESSD/SSD-based instances](https://help.aliyun.com/document_detail/2527111.html).

>  This parameter is required only when you set the **InstanceType** parameter to **tair_essd** to create an ESSD-based instance. If you create a Tair **SSD**-based instance, the Storage parameter is automatically specified based on predefined specifications. You do not need to specify this parameter.', example='60'),
  storageType?: string(name='StorageType', description='The storage type. Valid values: **essd_pl1**, **essd_pl2**, and **essd_pl3**.

>  This parameter is required only when you set the **InstanceType** parameter to **tair_essd** to create an ESSD-based instance.

Enumerated values:

*   essd_pl0
*   essd_pl1
*   essd_pl2
*   essd_pl3', example='essd_pl1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. A tag is a key-value pair.

>  A maximum of five key-value pairs can be specified at a time.', example='key1_test'),
      value?: string(name='Value', description='The value of the tag.

>  **N** specifies the value of the nth tag. For example, **Tag.1.Value** specifies the value of the first tag, and **Tag.2.Value** specifies the value of the second tag.', example='value1_test'),
    }
  ](name='Tag', description='Details of the tags.'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch that belongs to the VPC. You can call the [DescribeVpcs](https://help.aliyun.com/document_detail/35739.html) operation to query vSwitch IDs.

This parameter is required.', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC. You can call the [DescribeVpcs](https://help.aliyun.com/document_detail/35739.html) operation to query VPC IDs.

This parameter is required.', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', description='The ID of the primary zone. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent zone list.

>  You can also set the SecondaryZoneId parameter to specify the secondary zone. The primary and secondary nodes will then be deployed in the specified primary and secondary zones to implement the master-replica zone-disaster recovery architecture. For example, you can set the ZoneId parameter to cn-hangzhou-h and the SecondaryZoneId parameter to cn-hangzhou-g.', example='cn-hangzhou-e'),
}

model CreateTairInstanceResponseBody = {
  bandwidth?: long(name='Bandwidth', description='The maximum bandwidth of the instance. Unit: Mbit/s.', example='96'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PrePaid'),
  config?: string(name='Config', description='The detailed configurations of the instance. The value is a JSON string. For more information about the parameters, see [Configure parameters](https://help.aliyun.com/document_detail/43885.html).', example='{\\\\"EvictionPolicy\\\\":\\\\"volatile-lru\\\\",\\\\"hash-max-ziplist-entries\\\\":512,\\\\"zset-max-ziplist-entries\\\\":128,\\\\"list-max-ziplist-entries\\\\":512,\\\\"list-max-ziplist-value\\\\":64,\\\\"zset-max-ziplist-value\\\\":64,\\\\"set-max-intset-entries\\\\":512,\\\\"hash-max-ziplist-value\\\\":64}'),
  connectionDomain?: string(name='ConnectionDomain', description='The internal endpoint of the instance.', example='r-bp13ac3d047b****.tairpena.rds.aliyuncs.com'),
  connections?: long(name='Connections', description='The maximum number of connections to the instance.', example='10000'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp13ac3d047b****'),
  instanceName?: string(name='InstanceName', description='The instance name.

>  This parameter is returned only if the **InstanceName** parameter is specified in the request.', example='redistest'),
  instanceStatus?: string(name='InstanceStatus', description='The current status of the instance. The value is **Creating**.', example='Creating'),
  orderId?: long(name='OrderId', description='The order ID.', example='2084452111111'),
  port?: int32(name='Port', description='The service port number of the instance.', example='6379'),
  QPS?: long(name='QPS', description='The maximum number of read and write operations that can be processed by the instance per second. The value is a theoretical value.', example='100000'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The request ID.', example='12123216-4B00-4378-BE4B-08005BFC****'),
  taskId?: string(name='TaskId', description='The task ID.', example='10****'),
  zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-h'),
}

model CreateTairInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTairInstanceResponseBody(name='body'),
}

/**
 * @summary Creates a Tair (Enterprise Edition) cloud-native instance.
 *
 * @description For information about instance selection, see [Instructions for selecting an appropriate Tair (Redis OSS-compatible) instance](https://help.aliyun.com/document_detail/223808.html).
 * Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of Tair (Redis OSS-compatible).
 * > 
 * *   For information about how to create an instance in the console, see [Step 1: Create an instance](https://help.aliyun.com/document_detail/26351.html).
 * *   To create other types of instances, such as Redis Open-Source Edition instances or [Tair DRAM-based](https://help.aliyun.com/document_detail/126164.html) instances, you can call the [CreateInstance](https://help.aliyun.com/document_detail/473757.html) operation.
 *
 * @param request CreateTairInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTairInstanceResponse
 */
async function createTairInstanceWithOptions(request: CreateTairInstanceRequest, runtime: $RuntimeOptions): CreateTairInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.autoRenewPeriod)) {
    query['AutoRenewPeriod'] = request.autoRenewPeriod;
  }
  if (!$isNull(request.autoUseCoupon)) {
    query['AutoUseCoupon'] = request.autoUseCoupon;
  }
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.clusterBackupId)) {
    query['ClusterBackupId'] = request.clusterBackupId;
  }
  if (!$isNull(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.globalInstanceId)) {
    query['GlobalInstanceId'] = request.globalInstanceId;
  }
  if (!$isNull(request.globalSecurityGroupIds)) {
    query['GlobalSecurityGroupIds'] = request.globalSecurityGroupIds;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.paramGroupId)) {
    query['ParamGroupId'] = request.paramGroupId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.port)) {
    query['Port'] = request.port;
  }
  if (!$isNull(request.privateIpAddress)) {
    query['PrivateIpAddress'] = request.privateIpAddress;
  }
  if (!$isNull(request.readOnlyCount)) {
    query['ReadOnlyCount'] = request.readOnlyCount;
  }
  if (!$isNull(request.recoverConfigMode)) {
    query['RecoverConfigMode'] = request.recoverConfigMode;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.replicaCount)) {
    query['ReplicaCount'] = request.replicaCount;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!$isNull(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.shardCount)) {
    query['ShardCount'] = request.shardCount;
  }
  if (!$isNull(request.shardType)) {
    query['ShardType'] = request.shardType;
  }
  if (!$isNull(request.slaveReadOnlyCount)) {
    query['SlaveReadOnlyCount'] = request.slaveReadOnlyCount;
  }
  if (!$isNull(request.slaveReplicaCount)) {
    query['SlaveReplicaCount'] = request.slaveReplicaCount;
  }
  if (!$isNull(request.srcDBInstanceId)) {
    query['SrcDBInstanceId'] = request.srcDBInstanceId;
  }
  if (!$isNull(request.storage)) {
    query['Storage'] = request.storage;
  }
  if (!$isNull(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateTairInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a Tair (Enterprise Edition) cloud-native instance.
 *
 * @description For information about instance selection, see [Instructions for selecting an appropriate Tair (Redis OSS-compatible) instance](https://help.aliyun.com/document_detail/223808.html).
 * Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of Tair (Redis OSS-compatible).
 * > 
 * *   For information about how to create an instance in the console, see [Step 1: Create an instance](https://help.aliyun.com/document_detail/26351.html).
 * *   To create other types of instances, such as Redis Open-Source Edition instances or [Tair DRAM-based](https://help.aliyun.com/document_detail/126164.html) instances, you can call the [CreateInstance](https://help.aliyun.com/document_detail/473757.html) operation.
 *
 * @param request CreateTairInstanceRequest
 * @return CreateTairInstanceResponse
 */
async function createTairInstance(request: CreateTairInstanceRequest): CreateTairInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return createTairInstanceWithOptions(request, runtime);
}

model DeleteAccountRequest {
  accountName?: string(name='AccountName', description='The username of the account. You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/473816.html) operation to query the username of the account.

This parameter is required.', example='demoaccount'),
  instanceId?: string(name='InstanceId', description='The instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
}

model DeleteAccountResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='8129F11A-D70B-43A6-9455-CE9EAA71****'),
}

model DeleteAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAccountResponseBody(name='body'),
}

/**
 * @summary Deletes an account from a Tair (Redis OSS-compatible) instance.
 *
 * @description *   This operation is supported only for instances that are compatible with Redis 4.0 or later.
 * *   The instance must be in the Running state.
 *
 * @param request DeleteAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAccountResponse
 */
async function deleteAccountWithOptions(request: DeleteAccountRequest, runtime: $RuntimeOptions): DeleteAccountResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAccount',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an account from a Tair (Redis OSS-compatible) instance.
 *
 * @description *   This operation is supported only for instances that are compatible with Redis 4.0 or later.
 * *   The instance must be in the Running state.
 *
 * @param request DeleteAccountRequest
 * @return DeleteAccountResponse
 */
async function deleteAccount(request: DeleteAccountRequest): DeleteAccountResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAccountWithOptions(request, runtime);
}

model DeleteGlobalSecurityIPGroupRequest {
  globalIgName?: string(name='GlobalIgName', description='The name of the global IP whitelist template. The name must meet the following requirements:

*   The name can contain lowercase letters, digits, and underscores (_).
*   The name must start with a letter and end with a letter or a digit.
*   The name must be 2 to 120 characters in length.', example='test_123'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-kd2iop4aur9qwxnvh***'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4e******'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteGlobalSecurityIPGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='AD425AD3-CC7B-4EE2-A5CB-2F61BA73****'),
}

model DeleteGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a global IP whitelist template.
 *
 * @description Before you delete an IP whitelist template, you must unbind (disassociate) the instances that are currently associated with the template.
 *
 * @param request DeleteGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteGlobalSecurityIPGroupResponse
 */
async function deleteGlobalSecurityIPGroupWithOptions(request: DeleteGlobalSecurityIPGroupRequest, runtime: $RuntimeOptions): DeleteGlobalSecurityIPGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!$isNull(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteGlobalSecurityIPGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a global IP whitelist template.
 *
 * @description Before you delete an IP whitelist template, you must unbind (disassociate) the instances that are currently associated with the template.
 *
 * @param request DeleteGlobalSecurityIPGroupRequest
 * @return DeleteGlobalSecurityIPGroupResponse
 */
async function deleteGlobalSecurityIPGroup(request: DeleteGlobalSecurityIPGroupRequest): DeleteGlobalSecurityIPGroupResponse {
  var runtime = new $RuntimeOptions{};
  return deleteGlobalSecurityIPGroupWithOptions(request, runtime);
}

model DeleteInstanceRequest {
  globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance to which the instance belongs. This parameter is applicable to only China site (aliyun.com).', example='gr-bp14rkqrhac****'),
  instanceId?: string(name='InstanceId', description='The ID of the instance that you want to release.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D190D2'),
}

model DeleteInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInstanceResponseBody(name='body'),
}

/**
 * @summary Release the Redis instance.
 *
 * @description For more information about how to perform the corresponding operation in the console, see [Release an instance](https://help.aliyun.com/document_detail/43882.html).
 * Before you call this operation, make sure that the following requirements are met:
 * *   The instance is in the running state.
 * *   The instance is charged on a pay-as-you-go basis.
 * >  You cannot call this operation to release a subscription instance, which is automatically released when it expires. To release a subscription instance before it expires, submit a ticket.
 *
 * @param request DeleteInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInstanceResponse
 */
async function deleteInstanceWithOptions(request: DeleteInstanceRequest, runtime: $RuntimeOptions): DeleteInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.globalInstanceId)) {
    query['GlobalInstanceId'] = request.globalInstanceId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Release the Redis instance.
 *
 * @description For more information about how to perform the corresponding operation in the console, see [Release an instance](https://help.aliyun.com/document_detail/43882.html).
 * Before you call this operation, make sure that the following requirements are met:
 * *   The instance is in the running state.
 * *   The instance is charged on a pay-as-you-go basis.
 * >  You cannot call this operation to release a subscription instance, which is automatically released when it expires. To release a subscription instance before it expires, submit a ticket.
 *
 * @param request DeleteInstanceRequest
 * @return DeleteInstanceResponse
 */
async function deleteInstance(request: DeleteInstanceRequest): DeleteInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return deleteInstanceWithOptions(request, runtime);
}

model DeleteParameterGroupRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  parameterGroupId?: string(name='ParameterGroupId', description='The ID of the parameter template.

This parameter is required.', example='rpg-sys-00*****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteParameterGroupResponseBody = {
  paramGroupId?: string(name='ParamGroupId', description='The parameter template ID, which is globally unique.', example='sys-001*****'),
  requestId?: string(name='RequestId', description='Id of the request', example='2BE6E619-A657-42E3-AD2D-18F8428A****'),
}

model DeleteParameterGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteParameterGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a parameter template.
 *
 * @param request DeleteParameterGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteParameterGroupResponse
 */
async function deleteParameterGroupWithOptions(request: DeleteParameterGroupRequest, runtime: $RuntimeOptions): DeleteParameterGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.parameterGroupId)) {
    query['ParameterGroupId'] = request.parameterGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteParameterGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a parameter template.
 *
 * @param request DeleteParameterGroupRequest
 * @return DeleteParameterGroupResponse
 */
async function deleteParameterGroup(request: DeleteParameterGroupRequest): DeleteParameterGroupResponse {
  var runtime = new $RuntimeOptions{};
  return deleteParameterGroupWithOptions(request, runtime);
}

model DeleteShardingNodeRequest {
  effectiveTime?: string(name='EffectiveTime', description='The time when you want to delete the proxy nodes for instance in the proxy mode. Valid values:

*   **0 or Immediately** (default): immediately delete the proxy nodes.
*   **1 or MaintainTime**: delete the proxy nodes during the maintenance window.

>  You can call the [ModifyInstanceMaintainTime](https://help.aliyun.com/document_detail/473775.html) operation to modify the maintenance window of an instance.', example='Immediately'),
  forceTrans?: boolean(name='ForceTrans', description='Specifies whether to enable forced transmission during a configuration change. Valid values:

*   **false** (default): Before the configuration change, the system checks the minor version of the instance. If the minor version of the instance is outdated, an error is reported. You must update the minor version of the instance and try again.
*   **true**: The system skips the version check and directly performs the configuration change.', example='false'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the data shard that you want to remove. You can specify multiple IDs at a time. Separate multiple IDs with commas (,).

> If you specify both the NodeId and ShardCount parameters, the system prioritizes the NodeId parameter.', example='r-bp1zxszhcgatnx****-db-0,r-bp1zxszhcgatnx****-db-1', deprecated=true),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  shardCount?: int32(name='ShardCount', description='The number of data shards that you want to remove. Shard removal starts from the end of the shard list.

> For example, the instance has the following data shards: db-0, db-1, db-2, db-3, and db-4. In this case, if you set this parameter to 2, db-3 and db-4 are removed.', example='1'),
}

model DeleteShardingNodeResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order. On the Orders page in the Billing Management console, you can obtain the details of the order based on the order ID.', example='22179******0904'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model DeleteShardingNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteShardingNodeResponseBody(name='body'),
}

/**
 * @summary Removes one or more data shards from a Tair (Redis OSS-compatible) cluster instance.
 *
 * @description You can also remove data shards from an instance in the Tair (Redis OSS-compatible) console. For more information, see [Adjust the number of shards for an instance with cloud disks](https://help.aliyun.com/document_detail/198082.html).\\
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a persistent memory-optimized instance in the cluster architecture. For more information about persistent memory-optimized instances, see [Persistent memory-optimized instances](https://help.aliyun.com/document_detail/183956.html).
 * *   The instance has more than one data shard.
 *
 * @param request DeleteShardingNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteShardingNodeResponse
 */
async function deleteShardingNodeWithOptions(request: DeleteShardingNodeRequest, runtime: $RuntimeOptions): DeleteShardingNodeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.forceTrans)) {
    query['ForceTrans'] = request.forceTrans;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.shardCount)) {
    query['ShardCount'] = request.shardCount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteShardingNode',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes one or more data shards from a Tair (Redis OSS-compatible) cluster instance.
 *
 * @description You can also remove data shards from an instance in the Tair (Redis OSS-compatible) console. For more information, see [Adjust the number of shards for an instance with cloud disks](https://help.aliyun.com/document_detail/198082.html).\\
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a persistent memory-optimized instance in the cluster architecture. For more information about persistent memory-optimized instances, see [Persistent memory-optimized instances](https://help.aliyun.com/document_detail/183956.html).
 * *   The instance has more than one data shard.
 *
 * @param request DeleteShardingNodeRequest
 * @return DeleteShardingNodeResponse
 */
async function deleteShardingNode(request: DeleteShardingNodeRequest): DeleteShardingNodeResponse {
  var runtime = new $RuntimeOptions{};
  return deleteShardingNodeWithOptions(request, runtime);
}

model DescribeAccountsRequest {
  accountName?: string(name='AccountName', description='The name of the account that you want to query.', example='demoaccount'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAccountsResponseBody = {
  accounts?: {
    account?: [ 
    {
      accountDescription?: string(name='AccountDescription', description='The description of the account.', example='testdec'),
      accountName?: string(name='AccountName', description='The name of the account.', example='demoaccount'),
      accountStatus?: string(name='AccountStatus', description='The state of the account. Valid values:

*   **Unavailable**: The account is unavailable.
*   **Available**: The account is available.', example='Available'),
      accountType?: string(name='AccountType', description='The type of the account. Valid values:

*   **Normal**: standard account
*   **Super**: super account', example='Normal'),
      databasePrivileges?: {
        databasePrivilege?: [ 
        {
          accountPrivilege?: string(name='AccountPrivilege', description='The permission of the account. Default value: RoleReadWrite. Valid values:

*   **RoleReadOnly**: The account has the read-only permissions.
*   **RoleReadWrite**: The account has the read and write permissions.', example='RoleReadWrite'),
        }
      ](name='DatabasePrivilege')
      }(name='DatabasePrivileges', description='Details about account permissions.'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp10noxlhcoim2****'),
    }
  ](name='Account')
  }(name='Accounts', description='Details about returned accounts of the instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6C9E114C-217C-4118-83C0-B4070222****'),
}

model DescribeAccountsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountsResponseBody(name='body'),
}

/**
 * @summary Queries a specified account of a Tair (Redis OSS-compatible) instance.
 *
 * @description >  Only Tair (Redis OSS-compatible) instances of Redis 4.0 or later are supported.
 *
 * @param request DescribeAccountsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountsResponse
 */
async function describeAccountsWithOptions(request: DescribeAccountsRequest, runtime: $RuntimeOptions): DescribeAccountsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeAccounts',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a specified account of a Tair (Redis OSS-compatible) instance.
 *
 * @description >  Only Tair (Redis OSS-compatible) instances of Redis 4.0 or later are supported.
 *
 * @param request DescribeAccountsRequest
 * @return DescribeAccountsResponse
 */
async function describeAccounts(request: DescribeAccountsRequest): DescribeAccountsResponse {
  var runtime = new $RuntimeOptions{};
  return describeAccountsWithOptions(request, runtime);
}

model DescribeActiveOperationTaskRequest {
  isHistory?: int32(name='IsHistory', description='Specifies whether to return the historical tasks. Default value: 0. Valid values:

*   **0**: returns the current task.
*   **1**: returns the historical tasks.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than **0**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Specify a value greater than **10**. Default value: **30**.', example='30'),
  region?: string(name='Region', description='The region ID of the O&M task. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

> A value of **all** indicates all region IDs.

This parameter is required.', example='all'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  taskType?: string(name='TaskType', description='The type of the O\\\\&M task. Valid values:

*   **rds_apsaradb_ha**: master-replica switchover
*   **rds_apsaradb_transfer**: instance migration
*   **rds_apsaradb_upgrade**: minor version update

This parameter is required.', example='all'),
}

model DescribeActiveOperationTaskResponseBody = {
  items?: [ 
    {
      createdTime?: string(name='CreatedTime', description='The time when the O\\\\&M task was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-15 23:59:59'),
      dbType?: string(name='DbType', description='The database type of the instance. The return value is **Redis**.', example='redis'),
      deadline?: string(name='Deadline', description='The deadline before which the time to preform the O&M task can be modified. The time in UTC is displayed in the *yyyy-MM-dd*T*HH:mm:ss*Z format.', example='2018-07-19 23:59:59'),
      id?: int32(name='Id', description='The ID of the O&M task.', example='114111'),
      insName?: string(name='InsName', description='The ID of the instance.', example='r-bp1lgal1sdvxrz****'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the O\\\\&M task was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19 14:00:00'),
      prepareInterval?: string(name='PrepareInterval', description='The required preparation period between the task start time and the switchover time. The time is displayed in the *HH:mm:ss* format.', example='14:00:00'),
      region?: string(name='Region', description='The region ID of the instance.', example='cn-hanghzou'),
      startTime?: string(name='StartTime', description='The time when the O\\\\&M task was preformed. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19 10:00:00'),
      status?: int32(name='Status', description='The state of the O&M task. Valid values:

*   **2**: The task is waiting for users to specify a switchover time.
*   **3**: The task is waiting to be performed.
*   **4**: The task is being performed. If the task is in this state, the **ModifyActiveOperationTask** operation cannot be called to modify the scheduled switchover time.
*   **5**: The task is performed.
*   **6**: The task fails.
*   **7**: The task is canceled.', example='5'),
      switchTime?: string(name='SwitchTime', description='The time when the system performs the switchover operation. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19 14:00:00'),
      taskType?: string(name='TaskType', description='The type of the task. Valid values:

*   **rds_apsaradb_ha**: master-replica switchover
*   **rds_apsaradb_transfer**: instance migration
*   **rds_apsaradb_upgrade**: minor version update
*   **all**: all types', example='rds_apsaradb_upgrade'),
    }
  ](name='Items', description='The list of O\\\\&M tasks.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2E1FF0CC-F42A-4B6F-A1F4-A17B1451****'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned entries.', example='1'),
}

model DescribeActiveOperationTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTaskResponseBody(name='body'),
}

/**
 * @summary Queries the details of the O\\&M tasks of a Tair (Redis OSS-compatible) instance.
 *
 * @description After you have called this API operation and queried the information about a specific O&M task, you can also call the [ModifyActiveOperationTask](https://help.aliyun.com/document_detail/473864.html) operation to modify the scheduled switchover time of the O&M task.
 *
 * @param request DescribeActiveOperationTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTaskResponse
 */
async function describeActiveOperationTaskWithOptions(request: DescribeActiveOperationTaskRequest, runtime: $RuntimeOptions): DescribeActiveOperationTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.isHistory)) {
    query['IsHistory'] = request.isHistory;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeActiveOperationTask',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of the O\\&M tasks of a Tair (Redis OSS-compatible) instance.
 *
 * @description After you have called this API operation and queried the information about a specific O&M task, you can also call the [ModifyActiveOperationTask](https://help.aliyun.com/document_detail/473864.html) operation to modify the scheduled switchover time of the O&M task.
 *
 * @param request DescribeActiveOperationTaskRequest
 * @return DescribeActiveOperationTaskResponse
 */
async function describeActiveOperationTask(request: DescribeActiveOperationTaskRequest): DescribeActiveOperationTaskResponse {
  var runtime = new $RuntimeOptions{};
  return describeActiveOperationTaskWithOptions(request, runtime);
}

model DescribeActiveOperationTasksRequest {
  allowCancel?: int32(name='AllowCancel', description='The filter condition that is used to return events based on the settings of event cancellation. Default value: -1. Valid values:

*   **-1**: returns all events.
*   **0**: returns only O\\\\&M events that cannot be canceled.
*   **1**: returns only O\\\\&M events that can be canceled.', example='1'),
  allowChange?: int32(name='AllowChange', description='The filter condition that is used to return events based on the settings of the switching time. Default value: -1. Valid values:

*   **-1**: returns all events.
*   **0**: returns only O\\\\&M events for which the switching time cannot be changed.
*   **-1**: returns only O\\\\&M events for which the switching time can be changed.', example='-1'),
  changeLevel?: string(name='ChangeLevel', description='The type of task configuration change. Valid values:

*   **all** (default): The configurations of all O\\\\&M tasks are changed.
*   **S0**: The configurations of tasks initiated to fix exceptions are changed.
*   **S1**: The configurations of system O\\\\&M tasks are changed.', example='all'),
  dbType?: string(name='DbType', description='The database type. Valid values: **redis**', example='redis'),
  insName?: string(name='InsName', description='The name of the instance. You can leave this parameter empty. If you configure this parameter, you can specify the name only of one instance.', example='r-wz96fzmpvpr2qnqnlb'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 25. Maximum value: 100.', example='25'),
  productId?: string(name='ProductId', description='The name of the service. Valid values: RDS, POLARDB, MongoDB, and Redis. For Redis instances, set the value to Redis.', example='Redis'),
  region?: string(name='Region', description='The region ID of the O&M task. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

> A value of **all** indicates all region IDs.', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  status?: int32(name='Status', description='The status of an O\\\\&M event. This parameter is used to filter returned tasks. Valid values:

*   **-1**: filters all events.
*   **3**: filters pending events.
*   **4**: filters in-progress events.
*   **5**: filters successful events.
*   **6**: filters failed events.
*   **7**: filters canceled events.', example='3'),
  taskType?: string(name='TaskType', description='The type of the O\\\\&M event. If this parameter is not specified, all types of O\\\\&M events are queried.

Valid values:

*   rds_apsradb_upgrade: minor version update
*   rds_apsaradb_ha: primary/secondary switchover
*   rds_apsaradb_ssl_update: SSL certificate update
*   rds_apsaradb_major_upgrade: major version upgrade
*   rds_apsradb_transfer: instance migration
*   rds_apsaradb_modify_config: network upgrade
*   rds_apsaradb_modify_config: instance parameter adjustment
*   rds_apsaradb_maxscale: proxy minor version update', example='all'),
}

model DescribeActiveOperationTasksResponseBody = {
  items?: [ 
    {
      allowCancel?: string(name='AllowCancel', description='Indicates whether the event can be canceled. The value 1 indicates that the event can be canceled. The value 0 indicates that the event cannot be canceled.', example='1'),
      allowChange?: string(name='AllowChange', description='Indicates whether the switching time can be changed. The value 1 indicates that the switching time can be changed. The value 0 indicates that the switching time cannot be changed.', example='1'),
      changeLevel?: string(name='ChangeLevel', description='The code of the task level. The value S1 indicates the system O\\\\&M level. The value S0 indicates the exception fixing level.', example='S1'),
      changeLevelEn?: string(name='ChangeLevelEn', description='The level of the task in English.', example='System maintenance'),
      changeLevelZh?: string(name='ChangeLevelZh', description='The level of the task in Chinese.', example='系统运维'),
      createdTime?: string(name='CreatedTime', description='The time when the O\\\\&M task was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-05-30T14:30:00Z'),
      currentAVZ?: string(name='CurrentAVZ', description='The current zone.', example='cn-beijing-h'),
      dbType?: string(name='DbType', description='The database type of the instance. The return value is **Redis**.', example='redis'),
      dbVersion?: string(name='DbVersion', description='The version of the database engine.', example='5.0'),
      deadline?: string(name='Deadline', description='The deadline before which the time to preform the O&M task can be modified. The time in UTC is displayed in the *yyyy-MM-dd*T*HH:mm:ss*Z format.', example='2018-05-30T23:59:59Z'),
      id?: int32(name='Id', description='The ID of the O\\\\&M event.', example='11111'),
      impact?: string(name='Impact', description='The impact of the task.', example='TransientDisconnection'),
      impactEn?: string(name='ImpactEn', description='The impact of the task in English.', example='Transient instance disconnection'),
      impactZh?: string(name='ImpactZh', description='The impact of the task in Chinese.', example='实例闪断'),
      insComment?: string(name='InsComment', description='The alias and description of the instance.', example='test'),
      insName?: string(name='InsName', description='The instance ID.', example='r-bp1lgal1sdvxrz****'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the O\\\\&M task was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-05-30T14:30:00Z'),
      prepareInterval?: string(name='PrepareInterval', description='The required preparation period between the task start time and the switchover time. The time is displayed in the *HH:mm:ss* format.', example='04:00:00'),
      region?: string(name='Region', description='The region ID of the instance.', example='cn-hanghzou'),
      resultInfo?: string(name='ResultInfo', description='The information about the execution result.', example='userCancel'),
      startTime?: string(name='StartTime', description='The time when the event is executed in the backend. The time must be in UTC. Format: YYYY-MM-DDTHH:mm:ssZ.', example='2018-05-30T00:00:00Z'),
      status?: int32(name='Status', description='The status of the O\\\\&M event. Valid values:

*   **3**: filters pending events.
*   **4**: filters in-progress events.
*   **5**: filters successful events.
*   **6**: filters failed events.
*   **7**: filters canceled events.', example='5'),
      subInsNames?: [ string ](name='SubInsNames', description='The list of sub-events.'),
      switchTime?: string(name='SwitchTime', description='The time when the system performs the switchover operation. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-05-30T14:30:00Z'),
      taskParams?: string(name='TaskParams', description='The O\\\\&M event parameters.', example='{
      "Action": "UpgradeDBInstance"
}'),
      taskType?: string(name='TaskType', description='The type of the O\\\\&M event.', example='rds_apsaradb_transfer'),
      taskTypeEn?: string(name='TaskTypeEn', description='The cause of the O\\\\&M event.', example='Minor version update'),
      taskTypeZh?: string(name='TaskTypeZh', description='The reason for the task in Chinese.', example='小版本升级'),
    }
  ](name='Items', description='The list of O\\\\&M events.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page. Default 25.', example='25'),
  requestId?: string(name='RequestId', description='The request ID.', example='2D9F3768-EDA9-4811-943E-42C8006E****'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The number of O\\\\&M events returned.', example='1'),
}

model DescribeActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Queries the O\\\\\\\\\\\\&M event details of an instance.
 *
 * @param request DescribeActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasksWithOptions(request: DescribeActiveOperationTasksRequest, runtime: $RuntimeOptions): DescribeActiveOperationTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.allowCancel)) {
    query['AllowCancel'] = request.allowCancel;
  }
  if (!$isNull(request.allowChange)) {
    query['AllowChange'] = request.allowChange;
  }
  if (!$isNull(request.changeLevel)) {
    query['ChangeLevel'] = request.changeLevel;
  }
  if (!$isNull(request.dbType)) {
    query['DbType'] = request.dbType;
  }
  if (!$isNull(request.insName)) {
    query['InsName'] = request.insName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.productId)) {
    query['ProductId'] = request.productId;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeActiveOperationTasks',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the O\\\\\\\\\\\\&M event details of an instance.
 *
 * @param request DescribeActiveOperationTasksRequest
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasks(request: DescribeActiveOperationTasksRequest): DescribeActiveOperationTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeActiveOperationTasksWithOptions(request, runtime);
}

model DescribeAuditLogConfigRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeInstanceAttribute](https://help.aliyun.com/document_detail/473779.html) operation to query the region ID of the instance.

This parameter is required.', example='cn-hanghzou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAuditLogConfigResponseBody = {
  dbAudit?: string(name='DbAudit', description='Indicates whether the audit log feature is enabled. Valid values:

*   **true**: enabled
*   **false**: disabled

> You can call the [ModifyAuditLogConfig](https://help.aliyun.com/document_detail/473829.html) operation to enable or disable the audit log feature for a Tair (Redis OSS-compatible) instance.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2BE6E619-A657-42E3-AD2D-18F8428A****'),
  retention?: string(name='Retention', description='The retention period of audit logs. Unit: days.', example='5'),
}

model DescribeAuditLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditLogConfigResponseBody(name='body'),
}

/**
 * @summary Queries the audit log configurations of a Tair (Redis OSS-compatible) instance. The configurations include whether the audit log feature is enabled and the retention period of audit logs.
 *
 * @description Before you call this operation, you must enable the audit log feature for the instance. For more information, see [ModifyAuditLogConfig](https://help.aliyun.com/document_detail/473829.html) or [Enable the audit log feature](https://help.aliyun.com/document_detail/102015.html).
 *
 * @param request DescribeAuditLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditLogConfigResponse
 */
async function describeAuditLogConfigWithOptions(request: DescribeAuditLogConfigRequest, runtime: $RuntimeOptions): DescribeAuditLogConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeAuditLogConfig',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the audit log configurations of a Tair (Redis OSS-compatible) instance. The configurations include whether the audit log feature is enabled and the retention period of audit logs.
 *
 * @description Before you call this operation, you must enable the audit log feature for the instance. For more information, see [ModifyAuditLogConfig](https://help.aliyun.com/document_detail/473829.html) or [Enable the audit log feature](https://help.aliyun.com/document_detail/102015.html).
 *
 * @param request DescribeAuditLogConfigRequest
 * @return DescribeAuditLogConfigResponse
 */
async function describeAuditLogConfig(request: DescribeAuditLogConfigRequest): DescribeAuditLogConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeAuditLogConfigWithOptions(request, runtime);
}

model DescribeAuditRecordsRequest {
  accountName?: string(name='AccountName', description='The username of the account. If you do not specify this parameter, all accounts of the instance are queried.', example='demo'),
  databaseName?: string(name='DatabaseName', description='The name of the database in the instance. If you do not specify this parameter, all databases are queried. Valid values: 0 to 255. 0 specifies database 0.', example='0'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

> We recommend that you specify a time range of 10 minutes or less because audit logs contain a great number of entries. Do not specify a time range that is longer than one day.

This parameter is required.', example='2019-03-25T12:10:00Z'),
  hostAddress?: string(name='HostAddress', description='The IP address of the client. If you do not specify this parameter, this call applies to all clients.', example='127.0.0.1'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the node in the instance. You can set this parameter to query the monitoring data of a specified node.

> 

*   This parameter is available only for read/write splitting and cluster instances.

*   You can call the [DescribeLogicInstanceTopology](https://help.aliyun.com/document_detail/473786.html) operation to query node IDs.', example='r-bp1zxszhcgatnx****-db-0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='30'),
  queryKeywords?: string(name='QueryKeywords', description='The keyword based on which the audit logs are queried. You can specify a command as a keyword to query logs. By default, all commands are queried.

> You can specify only a single keyword in each call.', example='maxclients'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2019-03-24T12:10:00Z'),
}

model DescribeAuditRecordsResponseBody = {
  endTime?: string(name='EndTime', description='The end time of the query.', example='2019-03-25T12:10:00Z'),
  instanceName?: string(name='InstanceName', description='The name of the instance.', example='r-bp1zxszhcgatnx****'),
  items?: {
    SQL?: [ 
    {
      accountName?: string(name='AccountName', description='The username of the account.', example='demo'),
      databaseName?: string(name='DatabaseName', description='The database name.', example='demo'),
      executeTime?: string(name='ExecuteTime', description='The time when the command was run.', example='2019-03-25T03:22:08Z'),
      hostAddress?: string(name='HostAddress', description='The IP address of the client.', example='127.0.0.1'),
      IPAddress?: string(name='IPAddress', description='The IP address of the instance.', example='192.16.100.***'),
      nodeId?: string(name='NodeId', description='The ID of the node.

> A specific node ID is returned only if the instance uses the cluster or read/write splitting architecture.', example='r-bp1zxszhcgatnx****-db-0'),
      SQLText?: string(name='SQLText', description='The command that was run.', example='CONFIG GET maxmemory'),
      SQLType?: string(name='SQLType', description='The type of the command.', example='non_read_write'),
      totalExecutionTimes?: string(name='TotalExecutionTimes', description='The amount of time consumed to run the command.', example='0'),
    }
  ](name='SQL')
  }(name='Items', description='The collection of returned audit log entries.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9F5EB478-824E-4AC4-8D2B-58F31A02****'),
  startTime?: string(name='StartTime', description='The start time of the query.', example='2019-03-24T12:10:00Z'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned entries.', example='22222'),
}

model DescribeAuditRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the audit logs of a Tair (Redis OSS-compatible) instance.
 *
 * @description Before you call this operation, you must enable the audit log feature for the instance. For more information, see [ModifyAuditLogConfig](https://help.aliyun.com/document_detail/473829.html).
 *
 * @param request DescribeAuditRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditRecordsResponse
 */
async function describeAuditRecordsWithOptions(request: DescribeAuditRecordsRequest, runtime: $RuntimeOptions): DescribeAuditRecordsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.hostAddress)) {
    query['HostAddress'] = request.hostAddress;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.queryKeywords)) {
    query['QueryKeywords'] = request.queryKeywords;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeAuditRecords',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the audit logs of a Tair (Redis OSS-compatible) instance.
 *
 * @description Before you call this operation, you must enable the audit log feature for the instance. For more information, see [ModifyAuditLogConfig](https://help.aliyun.com/document_detail/473829.html).
 *
 * @param request DescribeAuditRecordsRequest
 * @return DescribeAuditRecordsResponse
 */
async function describeAuditRecords(request: DescribeAuditRecordsRequest): DescribeAuditRecordsResponse {
  var runtime = new $RuntimeOptions{};
  return describeAuditRecordsWithOptions(request, runtime);
}

model DescribeAvailableResourceRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The display language of the response. Valid values:

*   **zh-CN**: Chinese. This is the default value.
*   **en-US**: English.', example='zh-CN'),
  engine?: string(name='Engine', description='The database engine of the instance. Valid values:

*   **Redis**
*   **Memcache**', example='Redis'),
  instanceChargeType?: string(name='InstanceChargeType', description='The billing method. Valid values:

*   **PrePaid** (default): subscription
*   **PostPaid**: pay-as-you-go', example='PrePaid'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

> This parameter is available and required only if the **OrderType** parameter is set to **UPGRADE** or **DOWNGRADE**.', example='r-bp1zxszhcgatnx****'),
  instanceScene?: string(name='InstanceScene', description='The edition of the instance. Valid values:

*   **professional**: Standard Edition. This edition supports the standalone, master-replica, read /write splitting, and cluster architectures and provides high scalability.', example='professional'),
  nodeId?: string(name='NodeId', description='The ID of the data node for which you want to query available resources that can be created. You can call the [DescribeLogicInstanceTopology](https://help.aliyun.com/document_detail/473786.html) operation to query the ID of the data node. Remove the number sign (`#`) and the content that follows the number sign. For example, retain only r-bp10noxlhcoim2\\\\*\\\\*\\\\*\\\\*-db-0.

> Before you specify this parameter, you must set the **InstanceId** parameter to the ID of an instance that uses the cluster or read/write splitting architecture.', example='r-bp1zxszhcgatnx****-db-0'),
  orderType?: string(name='OrderType', description='The order type. Valid values:

*   **BUY** (default): orders that are used to create instances
*   **UPGRADE**: orders that are used to upgrade instances
*   **DOWNGRADE**: orders that are used to downgrade instances', example='BUY'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  productType?: string(name='ProductType', description='The instance type. Default value: Local. Valid values:

*   **Local**: classic Redis Open-Source Edition instance or classic DRAM-based instance
*   **Tair_rdb**: cloud-native DRAM-based instance
*   **Tair_scm**: persistent memory-optimized instance
*   **Tair_essd**: ESSD/SSD-based instance
*   **OnECS**: cloud-native Redis Open-Source Edition instance

>  The default value of this parameter is Local. To query disk resources, you must specify the instance type that provides the required disk resources.', example='Local'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs. You can call the [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html) operation to query the IDs of resource groups.

>  You can also query the IDs of resource groups in the Resource Management console. For more information, see [View basic information about a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4e******'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeZones](https://help.aliyun.com/document_detail/473764.html) operation to query the most recent zone list.', example='cn-hangzhou-h'),
}

model DescribeAvailableResourceResponseBody = {
  availableZones?: {
    availableZone?: [ 
    {
      isMainSale?: boolean(name='IsMainSale', description='An internal parameter.', example='true'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
      supportedEngines?: {
        supportedEngine?: [ 
        {
          engine?: string(name='Engine', description='The database engine of the instance.', example='Redis'),
          supportedEditionTypes?: {
            supportedEditionType?: [ 
            {
              editionType?: string(name='EditionType', description='The edition of the instance. Valid values:

*   **Community**: Community Edition
*   **Enterprise**: Enhanced Edition (Tair)', example='Enterprise'),
              supportedSeriesTypes?: {
                supportedSeriesType?: [ 
                {
                  seriesType?: string(name='SeriesType', description='The instance series. Valid values:

*   **enhanced_performance_type**: Tair (Enterprise Edition) DRAM-based instance
*   **hybrid_storage**: Redis Open-Source Edition hybrid-storage instance', example='enhanced_performance_type'),
                  supportedEngineVersions?: {
                    supportedEngineVersion?: [ 
                    {
                      supportedArchitectureTypes?: {
                        supportedArchitectureType?: [ 
                        {
                          architecture?: string(name='Architecture', description='The architecture of the instance. Valid values:

*   **standard**: standard architecture
*   **cluster**: cluster architecture
*   **rwsplit**: read/write splitting architecture', example='cluster'),
                          supportedShardNumbers?: {
                            supportedShardNumber?: [ 
                            {
                              shardNumber?: string(name='ShardNumber', description='The number of shards.', example='8'),
                              supportedNodeTypes?: {
                                supportedNodeType?: [ 
                                {
                                  availableResources?: {
                                    availableResource?: [ 
                                    {
                                      capacity?: long(name='Capacity', description='The memory size of the instance. Unit: MB.', example='16384'),
                                      instanceClass?: string(name='InstanceClass', description='The code of the instance type. If you want to view the code of an instance type, you can search for the code of the instance type in Help Center.', example='redis.amber.logic.sharding.2g.8db.0rodb.24proxy.multithread'),
                                      instanceClassRemark?: string(name='InstanceClassRemark', description='The description of the instance type.', example='16 GB cluster instance with 8 nodes (1,920,000 queries per second and 240,000 connections)'),
                                    }
                                  ](name='AvailableResource')
                                  }(name='AvailableResources', description='The available instance types.'),
                                  supportedNodeType?: string(name='SupportedNodeType', description='The node type of the instance. Valid values:

*   **single**: standalone
*   **double**: master-replica', example='double'),
                                }
                              ](name='SupportedNodeType')
                              }(name='SupportedNodeTypes', description='The supported node types.'),
                            }
                          ](name='SupportedShardNumber')
                          }(name='SupportedShardNumbers', description='The numbers of available shards.'),
                        }
                      ](name='SupportedArchitectureType')
                      }(name='SupportedArchitectureTypes', description='The available architectures.'),
                      version?: string(name='Version', description='The engine version of the instance.', example='5.0'),
                    }
                  ](name='SupportedEngineVersion')
                  }(name='SupportedEngineVersions', description='The available engine versions.'),
                }
              ](name='SupportedSeriesType')
              }(name='SupportedSeriesTypes', description='The instance series types.'),
            }
          ](name='SupportedEditionType')
          }(name='SupportedEditionTypes', description='The instance edition types.'),
        }
      ](name='SupportedEngine')
      }(name='SupportedEngines', description='The supported engines.'),
      zoneId?: string(name='ZoneId', description='The ID of the zone in which the instance is located.', example='cn-hangzhou-h'),
      zoneName?: string(name='ZoneName', description='The name of the zone.', example='Hangzhou Zone H'),
    }
  ](name='AvailableZone')
  }(name='AvailableZones', description='Details about the zones.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='493B7308-D9C2-55F6-B042-0313BD63****'),
}

model DescribeAvailableResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableResourceResponseBody(name='body'),
}

/**
 * @summary Queries the types of Tair (Redis OSS-compatible) instances that can be created in a specified zone.
 *
 * @param request DescribeAvailableResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableResourceResponse
 */
async function describeAvailableResourceWithOptions(request: DescribeAvailableResourceRequest, runtime: $RuntimeOptions): DescribeAvailableResourceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!$isNull(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!$isNull(request.instanceChargeType)) {
    query['InstanceChargeType'] = request.instanceChargeType;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.instanceScene)) {
    query['InstanceScene'] = request.instanceScene;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeAvailableResource',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the types of Tair (Redis OSS-compatible) instances that can be created in a specified zone.
 *
 * @param request DescribeAvailableResourceRequest
 * @return DescribeAvailableResourceResponse
 */
async function describeAvailableResource(request: DescribeAvailableResourceRequest): DescribeAvailableResourceResponse {
  var runtime = new $RuntimeOptions{};
  return describeAvailableResourceWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeBackupPolicyResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalType?: string(name='AuthPrincipalType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    noPermissionType?: string(name='NoPermissionType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    policyType?: string(name='PolicyType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
  }(name='AccessDeniedDetail', description='The following parameters are no longer used. Ignore the parameters.'),
  backupRetentionPeriod?: string(name='BackupRetentionPeriod', description='The retention period of the backup data. Unit: days.', example='7'),
  dbsInstance?: string(name='DbsInstance', description='Indicates whether the backup-as-a-service feature is enabled for the instance. Valid values:

*   **1**: The backup-as-a-service feature is enabled for the instance.
*   **0**: The backup-as-a-service feature is disabled for the instance.', example='0'),
  enableBackupLog?: int32(name='EnableBackupLog', description='Indicates whether incremental data backup is enabled. Valid values:

*   **1**: Incremental data backup is enabled.
*   **0**: Incremental data backup is disabled.', example='1'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The backup cycle. Valid values:

*   **Monday**
*   **Tuesday**
*   **Wednesday**
*   **Thursday**
*   **Friday**
*   **Saturday**
*   **Sunday**', example='Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The time range during which the backup was created. The time follows the ISO 8601 standard in the *HH:mm*Z-*HH:mm*Z format. The time is displayed in UTC.', example='05:00Z-06:00Z'),
  preferredNextBackupTime?: string(name='PreferredNextBackupTime', description='The next backup time. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time is displayed in UTC.', example='2019-03-14T05:28Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='90B82DB7-FB28-4CC2-ADBF-1F8659F3****'),
}

model DescribeBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupPolicyResponseBody(name='body'),
}

/**
 * @summary Queries the backup policy of a Tair (Redis OSS-compatible) instance, including the backup cycle and backup time.
 *
 * @param request DescribeBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: $RuntimeOptions): DescribeBackupPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupPolicy',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup policy of a Tair (Redis OSS-compatible) instance, including the backup cycle and backup time.
 *
 * @param request DescribeBackupPolicyRequest
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeBackupTasksRequest {
  backupJobId?: string(name='BackupJobId', description='The ID of the backup task.

>  If you call the [CreateBackup](https://help.aliyun.com/document_detail/473819.html) operation to perform a manual backup task, you can set this parameter to the returned backup ID to query the backup progress of the task.', example='1162****'),
  instanceId?: string(name='InstanceId', description='The instance ID. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query instance IDs.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  jobMode?: string(name='JobMode', description='The backup mode. Valid values:

*   **Automated**: automatic backup. You can call the [DescribeBackupPolicy](https://help.aliyun.com/document_detail/473822.html) operation to query the automatic backup policy.
*   **Manual**: manual backup.

>  By default, the information about backup tasks in both modes is returned.', example='Manual'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeBackupTasksResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalType?: string(name='AuthPrincipalType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    noPermissionType?: string(name='NoPermissionType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    policyType?: string(name='PolicyType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
  }(name='AccessDeniedDetail', description='The following parameters are no longer used. Ignore the parameters.'),
  backupJobs?: [ 
    {
      backupJobID?: long(name='BackupJobID', description='The ID of the backup task.', example='8491111'),
      backupProgressStatus?: string(name='BackupProgressStatus', description='The state of the backup task. Valid values:

*   **NoStart**: The backup task is not started.
*   **Preparing**: The backup task is being prepared.
*   **Waiting**: The backup task is pending.
*   **Uploading**: The system is uploading the backup file.
*   **Checking**: The system is checking the uploaded backup file.
*   **Finished**: The backup task is completed.', example='Automated'),
      jobMode?: string(name='JobMode', description='The backup mode. Valid values:

*   **Automated**: automatic backup
*   **Manual**: manual backup', example='Manual'),
      nodeId?: string(name='NodeId', description='The ID of the data node.', example='****'),
      process?: string(name='Process', description='The progress of the backup task in percentage.', example='0'),
      progress?: string(name='Progress', description='The backup progress.', example='27'),
      startTime?: string(name='StartTime', description='The start time of the backup task. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2021-01-05T19:24:00Z'),
      taskAction?: string(name='TaskAction', description='The type of the backup task. Valid values:

*   **TempBackupTask**: The backup task was manually performed.
*   **NormalBackupTask**: The backup task was automatically performed.', example='NormalBackupTask'),
    }
  ](name='BackupJobs', description='The details of the backup tasks.'),
  instanceId?: string(name='InstanceId', description='The instance ID.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The request ID.', example='BB73740C-23E2-4392-9DA4-2660C74C****'),
}

model DescribeBackupTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupTasksResponseBody(name='body'),
}

/**
 * @summary Queries the execution status of backup tasks for a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeBackupTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupTasksResponse
 */
async function describeBackupTasksWithOptions(request: DescribeBackupTasksRequest, runtime: $RuntimeOptions): DescribeBackupTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupJobId)) {
    query['BackupJobId'] = request.backupJobId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobMode)) {
    query['JobMode'] = request.jobMode;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupTasks',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the execution status of backup tasks for a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeBackupTasksRequest
 * @return DescribeBackupTasksResponse
 */
async function describeBackupTasks(request: DescribeBackupTasksRequest): DescribeBackupTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupTasksWithOptions(request, runtime);
}

model DescribeBackupsRequest {
  backupId?: long(name='BackupId', description='The ID of the backup file.', example='11611111'),
  backupJobId?: long(name='BackupJobId', description='The backup task ID, returned by CreateBackup. If CreateBackup returns multiple BackupJobIds, you need to use this interface to query each of them separately.', example='10001'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC. The end time must be later than the start time.

This parameter is required.', example='2019-03-14T18:00Z'),
  instanceId?: string(name='InstanceId', description='The ID of the instance whose backup files you want to query.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  needAof?: string(name='NeedAof', description='Specifies whether to enable append-only files (AOFs) persistence. Valid values:

*   **0**: no
*   **1**: yes

>  The default value is **0**.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. The value must be an integer that is greater than **0**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries per page. Valid values: 30, 50, 100, 200, and 300.', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2019-03-11T10:00Z'),
}

model DescribeBackupsResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    authPrincipalType?: string(name='AuthPrincipalType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    noPermissionType?: string(name='NoPermissionType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
    policyType?: string(name='PolicyType', description='This parameter is no longer used. Ignore this parameter.', example='_'),
  }(name='AccessDeniedDetail', description='The following parameters are no longer used. Ignore the parameters.'),
  backups?: {
    backup?: [ 
    {
      backupDBNames?: string(name='BackupDBNames', description='The names of the databases that are backed up. The default value is **all**, which indicates that all databases are backed up.', example='all'),
      backupDownloadURL?: string(name='BackupDownloadURL', description='The public download URL of the backup file.', example='https://rdsbak-hk45-v2.oss-cn-hongkong.aliyuncs.com/********'),
      backupEndTime?: string(name='BackupEndTime', description='The end time of the backup.', example='2019-03-14T05:31:13Z'),
      backupId?: long(name='BackupId', description='The ID of the backup file.', example='165*****50'),
      backupIntranetDownloadURL?: string(name='BackupIntranetDownloadURL', description='The internal download URL of the backup file.

>  You can use this URL to download the backup file from an Elastic Compute Service (ECS) instance that is connected to the ApsaraDB for Redis instance. The ECS instance must belong to the same classic network or reside in the same virtual private cloud (VPC) as the ApsaraDB for Redis instance.', example='https://rdsbak-hk45-v2.oss-cn-hongkong.aliyuncs.com/********'),
      backupJobID?: long(name='BackupJobID', description='The ID of the backup task.', example='24340'),
      backupMethod?: string(name='BackupMethod', description='The backup method. Valid values:

*   **Logical**
*   **Physical**', example='Physical'),
      backupMode?: string(name='BackupMode', description='The backup mode. Valid values:

*   **Automated**
*   **Manual**', example='Automated'),
      backupSize?: long(name='BackupSize', description='The size of the backup file.', example='1024'),
      backupStartTime?: string(name='BackupStartTime', description='The start time of the backup.', example='2019-03-14T05:28:50Z'),
      backupStatus?: string(name='BackupStatus', description='The status of the backup. Valid values:

*   **Success**
*   **Failed**', example='Success'),
      backupType?: string(name='BackupType', description='The backup type. Valid values:

*   **FullBackup**
*   **IncrementalBackup**', example='FullBackup'),
      engineVersion?: string(name='EngineVersion', description='The engine version (major version) of the instance.', example='4.0'),
      nodeInstanceId?: string(name='NodeInstanceId', description='The node ID.

>  If the instance uses the standard architecture, this parameter returns the instance ID.', example='r-bp10noxlhcoim2****-db-1'),
      recoverConfigMode?: string(name='RecoverConfigMode', description='If the backup includes account information, kernel parameters and whitelist details.', example='{"whitelist":true,"config":true,"account":true}'),
    }
  ](name='Backup')
  }(name='Backups', description='Details of the backup files.'),
  freeSize?: long(name='FreeSize', description='This parameter does not take effect. Ignore this parameter.', example='100000'),
  fullStorageSize?: long(name='FullStorageSize', description='The size of the full backup file of the instance. Unit: bytes. Full backups originate from scheduled backups, manual backups, and backups generated during cache analysis.

>  The value of this parameter is independent of the number and size of the returned backup sets. Instead, it reflects the total size of all valid full backups of the instance.', example='1000'),
  logStorageSize?: long(name='LogStorageSize', description='The size of the log backup file of the instance. Unit: bytes. This value is valid only when flashback is enabled.

>  The value of this parameter is independent of the number and size of the returned backup sets. Instead, it reflects the total size of all valid log backups of the instance.', example='5000'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='963C20F0-7CE1-4591-AAF3-6F3CD1CE****'),
  totalCount?: int32(name='TotalCount', description='The total number of backup files that were returned.', example='5'),
}

model DescribeBackupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupsResponseBody(name='body'),
}

/**
 * @summary Queries the backup files of the ApsaraDB for Redis instance.
 *
 * @param request DescribeBackupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupsResponse
 */
async function describeBackupsWithOptions(request: DescribeBackupsRequest, runtime: $RuntimeOptions): DescribeBackupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.backupJobId)) {
    query['BackupJobId'] = request.backupJobId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.needAof)) {
    query['NeedAof'] = request.needAof;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackups',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup files of the ApsaraDB for Redis instance.
 *
 * @param request DescribeBackupsRequest
 * @return DescribeBackupsResponse
 */
async function describeBackups(request: DescribeBackupsRequest): DescribeBackupsResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupsWithOptions(request, runtime);
}

model DescribeCacheAnalysisReportRequest {
  analysisType?: string(name='AnalysisType', description='The type of analytics. Set the value to **BigKey**.

This parameter is required.', example='BigKey'),
  date?: string(name='Date', description='The date to query. You can query the report for one day each time. Specify the date in the *yyyy-MM-dd*Z format. The time must be in UTC.

This parameter is required.', example='2019-08-05Z'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the child node in the cluster instance.

>  If you do not specify this parameter, the analysis results of all child nodes in the instance are returned.', example='-bp1zxszhcgatnx****-db-0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumbers?: int32(name='PageNumbers', description='The number of the page to return.

> If the parameter value exceeds the maximum number of the returned pages, an empty large key list is returned.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**.

> The default value is **30**.', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCacheAnalysisReportResponseBody = {
  bigKeys?: [  map[string]any ](name='BigKeys', description='Details of the large keys.'),
  hotKeys?: [  map[string]any ](name='HotKeys', description='Details of the hotkeys.

> This parameter is not returned because Tair (Redis OSS-compatible) does not support hotkey analytics.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of entries returned on the current page.', example='30'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A057C066-C3F5-4CC9-9FE4-A8D8B0DC****'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries returned.', example='160'),
}

model DescribeCacheAnalysisReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCacheAnalysisReportResponseBody(name='body'),
}

/**
 * @summary Queries the cache analysis report of an instance on a specified date.
 *
 * @description > Tair (Redis OSS-compatible) has optimized the cache analytics feature to improve user experience. This API operation is phased out. You can use the new API operation for cache analytics. For more information, see [API operations for cache analytics are upgraded](https://help.aliyun.com/document_detail/186019.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The engine version of the instance is Redis 4.0 or later.
 * *   The instance uses the latest minor version. For more information about how to check whether to update the minor version of an instance, see [How do I check whether the minor version of a Tair (Redis OSS-compatible) instance is the latest?](https://help.aliyun.com/document_detail/129203.html)
 *
 * @param request DescribeCacheAnalysisReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCacheAnalysisReportResponse
 */
async function describeCacheAnalysisReportWithOptions(request: DescribeCacheAnalysisReportRequest, runtime: $RuntimeOptions): DescribeCacheAnalysisReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.analysisType)) {
    query['AnalysisType'] = request.analysisType;
  }
  if (!$isNull(request.date)) {
    query['Date'] = request.date;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumbers)) {
    query['PageNumbers'] = request.pageNumbers;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCacheAnalysisReport',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the cache analysis report of an instance on a specified date.
 *
 * @description > Tair (Redis OSS-compatible) has optimized the cache analytics feature to improve user experience. This API operation is phased out. You can use the new API operation for cache analytics. For more information, see [API operations for cache analytics are upgraded](https://help.aliyun.com/document_detail/186019.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The engine version of the instance is Redis 4.0 or later.
 * *   The instance uses the latest minor version. For more information about how to check whether to update the minor version of an instance, see [How do I check whether the minor version of a Tair (Redis OSS-compatible) instance is the latest?](https://help.aliyun.com/document_detail/129203.html)
 *
 * @param request DescribeCacheAnalysisReportRequest
 * @return DescribeCacheAnalysisReportResponse
 */
async function describeCacheAnalysisReport(request: DescribeCacheAnalysisReportRequest): DescribeCacheAnalysisReportResponse {
  var runtime = new $RuntimeOptions{};
  return describeCacheAnalysisReportWithOptions(request, runtime);
}

model DescribeCacheAnalysisReportListRequest {
  days?: int32(name='Days', description='The time range to query. Default value: 7. Unit: days.

> If daily automatic analysis has not started and manual analysis is not performed, no records are returned.', example='7'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the child node in the cluster instance.

>  If you do not specify this parameter, the analysis results of all child nodes in the instance are returned.', example='r-bp1zxszhcgatnx****-db-0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumbers?: int32(name='PageNumbers', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**.

> The default value is **30**.', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCacheAnalysisReportListResponseBody = {
  dailyTasks?: {
    dailyTask?: [ 
    {
      date?: string(name='Date', description='The date when the offline key analytics task was performed.', example='2019-08-01Z'),
      tasks?: {
        task?: [ 
        {
          nodeId?: string(name='NodeId', description='The ID of the child node in the cluster instance.', example='r-bp1zxszhcgatnx****-db-0'),
          startTime?: string(name='StartTime', description='The start time of the offline key analytics task.', example='2019-08-01T19:08:49Z'),
          status?: string(name='Status', description='The state of the offline key analytics task. Valid values:

*   **success**
*   **running**', example='success'),
          taskId?: string(name='TaskId', description='The ID of the task.', example='156465****'),
        }
      ](name='Task')
      }(name='Tasks', description='Details about the offline key analysis reports.'),
    }
  ](name='DailyTask')
  }(name='DailyTasks', description='The list of the offline key analysis reports.'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='1041xxxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='743D0A03-52DE-4E6F-8D09-EC1414CF****'),
}

model DescribeCacheAnalysisReportListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCacheAnalysisReportListResponseBody(name='body'),
}

/**
 * @summary Queries a list of cache analysis reports for an instance.
 *
 * @description > Tair (Redis OSS-compatible) has optimized the cache analytics feature to improve user experience. This API operation is phased out. You can use the new API operation for cache analytics. For more information, see [API operations for cache analytics are upgraded](https://help.aliyun.com/document_detail/186019.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The engine version of the instance is Redis 4.0 or later.
 * *   The instance uses the latest minor version. For more information about how to check whether to update the minor version of an instance, see [How do I check whether the minor version of a Tair (Redis OSS-compatible) instance is the latest?](https://help.aliyun.com/document_detail/129203.html)
 *
 * @param request DescribeCacheAnalysisReportListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCacheAnalysisReportListResponse
 */
async function describeCacheAnalysisReportListWithOptions(request: DescribeCacheAnalysisReportListRequest, runtime: $RuntimeOptions): DescribeCacheAnalysisReportListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.days)) {
    query['Days'] = request.days;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumbers)) {
    query['PageNumbers'] = request.pageNumbers;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCacheAnalysisReportList',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of cache analysis reports for an instance.
 *
 * @description > Tair (Redis OSS-compatible) has optimized the cache analytics feature to improve user experience. This API operation is phased out. You can use the new API operation for cache analytics. For more information, see [API operations for cache analytics are upgraded](https://help.aliyun.com/document_detail/186019.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The engine version of the instance is Redis 4.0 or later.
 * *   The instance uses the latest minor version. For more information about how to check whether to update the minor version of an instance, see [How do I check whether the minor version of a Tair (Redis OSS-compatible) instance is the latest?](https://help.aliyun.com/document_detail/129203.html)
 *
 * @param request DescribeCacheAnalysisReportListRequest
 * @return DescribeCacheAnalysisReportListResponse
 */
async function describeCacheAnalysisReportList(request: DescribeCacheAnalysisReportListRequest): DescribeCacheAnalysisReportListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCacheAnalysisReportListWithOptions(request, runtime);
}

model DescribeClusterBackupListRequest {
  clusterBackupId?: string(name='ClusterBackupId', description='The backup set ID.', example='cb-hyxdof5x9kqbtust'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC. The end time must be later than the start time.

This parameter is required.', example='2021-05-13T00:00:00Z'),
  instanceId?: string(name='InstanceId', description='The instance ID.

This parameter is required.', example='r-t4nj72oug5r5646qog'),
  noShardBackup?: string(name='NoShardBackup', description='Specifies whether to show backup set information for shards in the instance.

*   **true**: does not show backup set information for shards in the instance.
*   **false** (default): shows backup set information for shards in the instance.

Valid values:

*   True
*   False', example='True'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values:

*   30
*   50
*   100
*   200
*   300
*   5
*   10
*   15
*   20', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

This parameter is required.', example='cn-zhangjiakou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2018-12-03T07:01Z'),
}

model DescribeClusterBackupListResponseBody = {
  clusterBackups?: [ 
    {
      backups?: [ 
        {
          backupDownloadURL?: string(name='BackupDownloadURL', description='The public download URL of the backup file.', example='http://rdsbakbucket-huhehaote-v2.oss-cn-huhehaote.aliyuncs.com/custins424747958/hins100322105_data_20240110012135.rdb'),
          backupEndTime?: string(name='BackupEndTime', description='The end time of the backup. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2024-01-09T17:21:57'),
          backupId?: string(name='BackupId', description='The ID of the backup file.', example='514645788'),
          backupIntranetDownloadURL?: string(name='BackupIntranetDownloadURL', description='The internal download URL of the backup file.

>  You can use this URL to download the backup file from an Elastic Compute Service (ECS) instance that is connected to the Tair (Redis OSS-compatible) instance. The ECS instance must reside in the same virtual private cloud (VPC) as the Tair (Redis OSS-compatible) instance.', example='http://rdsbakbucket-huhehaote-v2.oss-cn-huhehaote-internal.aliyuncs.com/custins424747958/hins100322105_data_20240110012135.rdb'),
          backupName?: string(name='BackupName', description='The name of the backup.', example='hins100322105_data_20240110012135.rdb'),
          backupSize?: string(name='BackupSize', description='The size of the backup file. Unit: bytes.', example='1024'),
          backupStartTime?: string(name='BackupStartTime', description='The start time of the backup. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2024-01-09T17:21:30Z'),
          backupStatus?: string(name='BackupStatus', description='The status of the backup. Valid values:

*   **OK**
*   **ERROR**', example='OK'),
          engine?: string(name='Engine', description='The database engine. The return value is **redis**.', example='redis'),
          extraInfo?: {
            custinsDbVersion?: string(name='CustinsDbVersion', description='The engine version.', example='5.0'),
          }(name='ExtraInfo', description='The additional information.'),
          instanceName?: string(name='InstanceName', description='The instance name.', example='hins100322105_data_20240108012127.rdb'),
          isAvail?: string(name='IsAvail', description='Indicates whether the backup set is available. Valid values:

*   **0**: unavailable
*   **1**: available', example='1'),
          recoverConfigMode?: string(name='RecoverConfigMode', description='This parameter does not take effect. Ignore this parameter.', example='null'),
        }
      ](name='Backups', description='The backup sets of all shards in the instance.'),
      clusterBackupEndTime?: string(name='ClusterBackupEndTime', description='The end time of the backup.', example='2024-01-10T17:21:55Z'),
      clusterBackupId?: string(name='ClusterBackupId', description='The ID of the backup set.', example='cb-zmdqj2m3xyxjtdt0'),
      clusterBackupMode?: string(name='ClusterBackupMode', description='The backup mode.', example='Automated'),
      clusterBackupSize?: string(name='ClusterBackupSize', description='The size of the backup set.', example='2048'),
      clusterBackupStartTime?: string(name='ClusterBackupStartTime', description='The start time of the backup.', example='2024-01-10T17:21:25Z'),
      clusterBackupStatus?: string(name='ClusterBackupStatus', description='The status of the backup set.

*   OK
*   RUNNING
*   Failed', example='OK'),
      isAvail?: int32(name='IsAvail', description='Indicates whether the backup set is valid. A value of 0 indicates that shard-level backups failed or have not been completed.', example='1'),
      progress?: string(name='Progress', description='The backup progress. The system displays only the progress of running backup tasks.', example='100%'),
      shardClassMemory?: int32(name='ShardClassMemory', description='The memory size of a single shard during a full backup. Unit: MB.', example='1024'),
    }
  ](name='ClusterBackups', description='The backup sets of the instance. A backup contains the backup sets of all shards in the instance.'),
  freeSize?: long(name='FreeSize', description='This parameter does not take effect. Ignore this parameter.', example='100000'),
  fullStorageSize?: long(name='FullStorageSize', description='The size of the full backup file of the instance. Unit: bytes. Full backups originate from scheduled backups, manual backups, and backups generated during cache analysis.

>  The value of this parameter is independent of the number and size of returned backup sets. Instead, it represents the size of all valid full backups of the instance.', example='1000'),
  logStorageSize?: long(name='LogStorageSize', description='The size of the log backup file of the instance. Unit: bytes. This parameter is valid only when flashback is enabled.

>  The value of this parameter is independent of the number and size of returned backup sets. Instead, it represents the size of all valid log backups of the instance.', example='5000'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='4'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='C009DA42-3B19-5B81-963D-1509DE2408DD'),
}

model DescribeClusterBackupListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterBackupListResponseBody(name='body'),
}

/**
 * @summary Queries the backup sets of a Tair (Redis OSS-compatible) cluster instance.
 *
 * @description This operation is applicable only to cloud-native instances.
 *
 * @param request DescribeClusterBackupListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterBackupListResponse
 */
async function describeClusterBackupListWithOptions(request: DescribeClusterBackupListRequest, runtime: $RuntimeOptions): DescribeClusterBackupListResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeClusterBackupList',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup sets of a Tair (Redis OSS-compatible) cluster instance.
 *
 * @description This operation is applicable only to cloud-native instances.
 *
 * @param request DescribeClusterBackupListRequest
 * @return DescribeClusterBackupListResponse
 */
async function describeClusterBackupList(request: DescribeClusterBackupListRequest): DescribeClusterBackupListResponse {
  var runtime = new $RuntimeOptions{};
  return describeClusterBackupListWithOptions(request, runtime);
}

model DescribeClusterMemberInfoRequest {
  instanceId?: string(name='InstanceId', description='The ID of the Tair (Redis OSS-compatible) instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query instance IDs.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**. Default value: **30**.', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeClusterMemberInfoResponseBody = {
  clusterChildren?: [ 
    {
      bandWidth?: long(name='BandWidth', description='The maximum bandwidth of the node. Unit: MB/s.

> This parameter is returned only if the return value of **Service** is **redis**, which indicates a data node.', example='96'),
      binlogRetentionDays?: int32(name='BinlogRetentionDays', description='The retention period of binlogs.', example='7'),
      bizType?: string(name='BizType', description='The type of workload. The return value is **ALIYUN**.', example='ALIYUN'),
      capacity?: long(name='Capacity', description='The maximum memory capacity per data node. Unit: MB.

> This parameter is returned only if the return value of **Service** is **redis**, which indicates a data node.', example='1024'),
      classCode?: string(name='ClassCode', description='The specifications of the data node. For more information, see [Community Edition instances that use cloud disks](https://help.aliyun.com/document_detail/164477.html).', example='redis.shard.small.ce'),
      connections?: long(name='Connections', description='The maximum number of connections supported by the data node.', example='20000'),
      currentBandWidth?: long(name='CurrentBandWidth', description='The current bandwidth of the data node, which is the sum of the default bandwidth and any extra bandwidth that is purchased. Unit: Mbit/s.', example='100'),
      diskSizeMB?: int32(name='DiskSizeMB', description='The storage capacity of the [enhanced SSD (ESSD)](https://help.aliyun.com/document_detail/122389.html) that is used by the data node. Unit: MB.

> The ESSD is used only to store system operating data, such as Persistent Memory (PMEM). It is not used as a medium to write and read data.', example='4096'),
      id?: long(name='Id', description='The ID of the replica set in the node.', example='501791111'),
      name?: string(name='Name', description='The name of the data node.', example='r-bp1zxszhcgatnx****-db-0'),
      replicaSize?: int32(name='ReplicaSize', description='The number of replica nodes.', example='0'),
      resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group to which the node belongs.', example='GLOBAL_ZHANGJIAKOU_A'),
      service?: string(name='Service', description='The node type. Valid values:

*   **redis**: data node
*   **redis_cs**: config server', example='redis'),
      serviceVersion?: string(name='ServiceVersion', description='The major version of the node.', example='5.0'),
      userId?: string(name='UserId', description='The ID of the user.', example='2****_176498472570****'),
    }
  ](name='ClusterChildren', description='Details about data nodes in the cluster instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2D9F3768-EDA9-4811-943E-42C8006E****'),
}

model DescribeClusterMemberInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterMemberInfoResponseBody(name='body'),
}

/**
 * @summary Queries the configuration information of nodes in a Tair (Redis OSS-compatible) cluster instance, such as the specifications and the maximum number of connections.
 *
 * @description > This API operation is applicable only to Tair (Redis OSS-compatible) instances that use [cloud disks](https://help.aliyun.com/document_detail/188068.html) and the [cluster architecture](https://help.aliyun.com/document_detail/52228.html).
 *
 * @param request DescribeClusterMemberInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterMemberInfoResponse
 */
async function describeClusterMemberInfoWithOptions(request: DescribeClusterMemberInfoRequest, runtime: $RuntimeOptions): DescribeClusterMemberInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeClusterMemberInfo',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the configuration information of nodes in a Tair (Redis OSS-compatible) cluster instance, such as the specifications and the maximum number of connections.
 *
 * @description > This API operation is applicable only to Tair (Redis OSS-compatible) instances that use [cloud disks](https://help.aliyun.com/document_detail/188068.html) and the [cluster architecture](https://help.aliyun.com/document_detail/52228.html).
 *
 * @param request DescribeClusterMemberInfoRequest
 * @return DescribeClusterMemberInfoResponse
 */
async function describeClusterMemberInfo(request: DescribeClusterMemberInfoRequest): DescribeClusterMemberInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeClusterMemberInfoWithOptions(request, runtime);
}

model DescribeDBInstanceNetInfoRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeDBInstanceNetInfoResponseBody = {
  instanceNetworkType?: string(name='InstanceNetworkType', description='The network type. Valid values:

*   **CLASSIC**: The instance runs in a classic network.
*   **VPC**: The instance runs in a virtual private cloud (VPC).', example='CLASSIC'),
  netInfoItems?: {
    instanceNetInfo?: [ 
    {
      connectionString?: string(name='ConnectionString', description='The endpoint of the instance.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
      DBInstanceNetType?: string(name='DBInstanceNetType', description='The network type of the instance. Valid values:

*   **0**: Internet
*   **1**: classic network
*   **2**: Virtual Private Cloud (VPC)', example='1'),
      directConnection?: int32(name='DirectConnection', description='Indicates whether the address is a private endpoint. Valid values:

*   **0**: The address is not a private endpoint.
*   **1**: The address is a private endpoint.', example='0'),
      expiredTime?: string(name='ExpiredTime', description='The expiration time of the classic network endpoint. Unit: seconds.', example='5183779'),
      IPAddress?: string(name='IPAddress', description='The IP address.', example='172.16.49.***'),
      IPType?: string(name='IPType', description='The network type of the IP address. Valid values:

*   **Public**: Internet
*   **Inner**: classic network
*   **Private**: VPC', example='Inner'),
      isSlaveProxy?: int32(name='IsSlaveProxy', description='Indicates whether the address is the endpoint for the secondary zone. Valid values: 1 and 0. A value of 1 indicates that the address is the endpoint for the secondary zone.

>  This parameter is returned only after you enable the multi-zone read/write splitting architecture for the instance.', example='1'),
      port?: string(name='Port', description='The service port of the instance.', example='6379'),
      upgradeable?: string(name='Upgradeable', description='The remaining validity period of the classic network endpoint. Unit: seconds.

>  **A value of 0 indicates that the endpoint never expires.', example='0'),
      VPCId?: string(name='VPCId', description='The ID of the VPC to which the instance belongs.', example='vpc-bp1nme44gek34slfc****'),
      VPCInstanceId?: string(name='VPCInstanceId', description='The instance ID.', example='r-bp1ky7j6qc7umk****'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-bp1e7clcw529l773d****'),
    }
  ](name='InstanceNetInfo')
  }(name='NetInfoItems', description='The network information about the instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FC77D4E1-2A7C-4F0B-A4CC-CE0B9C314B9B'),
}

model DescribeDBInstanceNetInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceNetInfoResponseBody(name='body'),
}

/**
 * @summary Queries the network information of an ApsaraDB for Redis instance.
 *
 * @param request DescribeDBInstanceNetInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceNetInfoResponse
 */
async function describeDBInstanceNetInfoWithOptions(request: DescribeDBInstanceNetInfoRequest, runtime: $RuntimeOptions): DescribeDBInstanceNetInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceNetInfo',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the network information of an ApsaraDB for Redis instance.
 *
 * @param request DescribeDBInstanceNetInfoRequest
 * @return DescribeDBInstanceNetInfoResponse
 */
async function describeDBInstanceNetInfo(request: DescribeDBInstanceNetInfoRequest): DescribeDBInstanceNetInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceNetInfoWithOptions(request, runtime);
}

model DescribeDBNodeDirectVipInfoRequest {
  instanceId?: string(name='InstanceId', description='The instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBNodeDirectVipInfoResponseBody = {
  directVipInfo?: {
    vipInfo?: [ 
    {
      netType?: string(name='NetType', description='The network type of the security group. Valid values:

*   **vpc**: Virtual Private Cloud (VPC)', example='vpc'),
      nodeId?: string(name='NodeId', description='The shard ID.', example='r-8vb3679b04551444-db-2'),
      port?: string(name='Port', description='The port number. Valid values: **1024** to **65535**. Default value: **6379**.', example='6379'),
      vip?: string(name='Vip', description='The VIP of the shard.', example='100.115.61.8'),
    }
  ](name='VipInfo')
  }(name='DirectVipInfo', description='The VIP information of shards in the cluster instance.'),
  instanceId?: string(name='InstanceId', description='The instance ID.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The request ID.', example='ABAF95F6-35C1-4177-AF3A-70969EBD****'),
}

model DescribeDBNodeDirectVipInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBNodeDirectVipInfoResponseBody(name='body'),
}

/**
 * @summary Queries the information about virtual IP addresses (VIPs) of child instances of a cluster instance in direct connection mode.
 *
 * @description > Only instances that use cloud disks support this operation.
 *
 * @param request DescribeDBNodeDirectVipInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBNodeDirectVipInfoResponse
 */
async function describeDBNodeDirectVipInfoWithOptions(request: DescribeDBNodeDirectVipInfoRequest, runtime: $RuntimeOptions): DescribeDBNodeDirectVipInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBNodeDirectVipInfo',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about virtual IP addresses (VIPs) of child instances of a cluster instance in direct connection mode.
 *
 * @description > Only instances that use cloud disks support this operation.
 *
 * @param request DescribeDBNodeDirectVipInfoRequest
 * @return DescribeDBNodeDirectVipInfoResponse
 */
async function describeDBNodeDirectVipInfo(request: DescribeDBNodeDirectVipInfoRequest): DescribeDBNodeDirectVipInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBNodeDirectVipInfoWithOptions(request, runtime);
}

model DescribeDedicatedClusterInstanceListRequest {
  clusterId?: string(name='ClusterId', description='The ID of the dedicated cluster. You can view the dedicated cluster ID on the Dedicated Clusters page in the ApsaraDB for MyBase console.

> Separate multiple IDs with commas (,).', example='dhg-5f2v98840ioq****'),
  dedicatedHostName?: string(name='DedicatedHostName', description='The ID of the host in the dedicated cluster. You can call the [DescribeDedicatedHosts](https://help.aliyun.com/document_detail/200944.html) operation to query the host ID.

> Separate multiple IDs with commas (,).', example='ch-t4n664a9mal4c****'),
  engine?: string(name='Engine', description='The database engine of the instance. Set the value to **Redis**.', example='Redis'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Set the value to **5.0**.', example='5.0'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

> The instance must be created by using a dedicated cluster. For more information, see [What is ApsaraDB for MyBase?](https://help.aliyun.com/document_detail/141455.html)', example='r-bp1zxszhcgatnx****'),
  instanceNetType?: string(name='InstanceNetType', description='The network type of the instance. Valid values:

*   **0**: Internet
*   **1**: classic network
*   **2**: Virtual Private Cloud (VPC)', example='2'),
  instanceStatus?: int32(name='InstanceStatus', description='The state of the instance. Valid values:

*   **0**: The instance is being created.
*   **1**: The instance is running.
*   **3**: The instance is being deleted.
*   **5**: The configurations of the instance are being changed.
*   **6**: The instance is being migrated.
*   **7**: The instance is being restored from a backup.
*   **8**: A master-replica switchover is in progress.
*   **9**: Expired data of the instance is being deleted.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than **0**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**. Default value: **30**.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeZones](https://help.aliyun.com/document_detail/473764.html) operation to query the most recent zone list.', example='cn-hangzhou-e'),
}

model DescribeDedicatedClusterInstanceListResponseBody = {
  instances?: [ 
    {
      bandWidth?: long(name='BandWidth', description='The default bandwidth of the instance. Unit: Mbit/s.', example='24'),
      characterType?: string(name='CharacterType', description='The architecture of the instance. Valid values:

*   **logic**: cluster
*   **normal**: standard', example='logic'),
      clusterId?: string(name='ClusterId', description='The ID of the dedicated cluster to which the instance belongs.', example='dhg-rx71fc5ndh9o****'),
      clusterName?: string(name='ClusterName', description='The name of the dedicated cluster to which the instance belongs.', example='testname'),
      connectionDomain?: string(name='ConnectionDomain', description='The private endpoint of the instance.', example='r-t4ncdi1dgi0ja8****.redis.hangzhou.rds.aliyuncs.com'),
      createTime?: string(name='CreateTime', description='The time when the instance was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2021-05-06T07:09:40Z'),
      currentBandWidth?: long(name='CurrentBandWidth', description='The current bandwidth of the instance, which is the sum of the default bandwidth and any extra bandwidth that is purchased. Unit: Mbit/s.', example='50'),
      customId?: string(name='CustomId', description='An internal parameter used for the maintenance and management of instances.', example='4652****'),
      engine?: string(name='Engine', description='The database engine. The return value is **redis**.', example='redis'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. The return value is **5.0**.', example='5.0'),
      instanceClass?: string(name='InstanceClass', description='The instance type.', example='redis.cluster.sharding.common.ce'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1e7vl6ygf1yq****'),
      instanceName?: string(name='InstanceName', description='The instance name.', example='testdb'),
      instanceNodeList?: [ 
        {
          dedicatedHostName?: string(name='DedicatedHostName', description='The ID of the host in the dedicated cluster.', example='ch-bp13vf0y9gx3c****'),
          instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1e7vl6ygf1yq****'),
          nodeId?: int32(name='NodeId', description='The node ID.', example='17921111'),
          nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='10.0.33.***'),
          nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **db**: data node.
*   **proxy**: proxy node.
*   **normal**: regular node. This value is returned when the instance runs in the standard architecture.', example='normal'),
          port?: int32(name='Port', description='The port number that is used to connect to the node.', example='3001'),
          role?: string(name='Role', description='The role of the node. Valid values:

*   **master**: master node
*   **slave**: replica node', example='master'),
          zoneId?: string(name='ZoneId', description='The zone ID of the node.', example='cn-hangzhou-h'),
        }
      ](name='InstanceNodeList', description='Details about the nodes.'),
      instanceStatus?: string(name='InstanceStatus', description='The state of the instance. Valid values:

*   **Normal**: The instance is normal.
*   **Creating**: The instance is being created.
*   **Changing**: The configurations of the instance are being changed.
*   **Inactive**: The instance is disabled.
*   **Flushing**: The instance is being released.
*   **Released**: The instance is released.
*   **Transforming**: The billing method of the instance is being changed.
*   **Unavailable**: The instance is unavailable.
*   **Error**: The instance failed to be created.
*   **Migrating**: The instance is being migrated.
*   **BackupRecovering**: The instance is being restored from a backup.
*   **MinorVersionUpgrading**: The minor version of the instance is being updated.
*   **NetworkModifying**: The network type of the instance is being changed.
*   **SSLModifying**: The SSL configurations of the instance are being changed.
*   **MajorVersionUpgrading**: The major version of the instance is being upgraded. The instance remains accessible during the upgrade.', example='Normal'),
      maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window. The time is in the *HH:mm*Z format. The time is displayed in UTC.', example='17:00Z'),
      maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window. The time is in the *HH:mm*Z format. The time is displayed in UTC.', example='16:00Z'),
      proxyCount?: int32(name='ProxyCount', description='The number of proxy nodes.

> 

*   If the return value is **0**, the proxy mode is disabled for the instance. If the return value is an integer greater than **0**, such as **1**, the proxy mode is enabled for the instance.

*   This parameter is returned only when the instance is a [cluster](https://help.aliyun.com/document_detail/52228.html) instance.', example='1'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
      shardCount?: int32(name='ShardCount', description='The number of shards.

>  This parameter is returned only when the instance is a [cluster](https://help.aliyun.com/document_detail/52228.html) instance.', example='3'),
      storageType?: string(name='StorageType', description='The storage type of the instance. The return value is LOCAL_SSD, which indicates [enhanced SSDs (ESSDs)](https://help.aliyun.com/document_detail/122389.html).', example='LOCAL_SSD'),
      vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-t4n2clc70t3hqwsrr****'),
      vswitchId?: string(name='VswitchId', description='The vSwitch ID.', example='vsw-t4nvrca24dczppq44****'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-e'),
    }
  ](name='Instances', description='Details about the instances.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='712CCF2A-16BD-411B-93F7-E978BEF2****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeDedicatedClusterInstanceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDedicatedClusterInstanceListResponseBody(name='body'),
}

/**
 * @summary Queries the information of Tair (Redis OSS-compatible) instances deployed in a dedicated cluster.
 *
 * @description > If you want to query the information about Tair (Redis OSS-compatible) instances that are not deployed in a dedicated cluster, call the [DescribeInstanceAttribute](https://help.aliyun.com/document_detail/473779.html) operation.
 *
 * @param request DescribeDedicatedClusterInstanceListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDedicatedClusterInstanceListResponse
 */
async function describeDedicatedClusterInstanceListWithOptions(request: DescribeDedicatedClusterInstanceListRequest, runtime: $RuntimeOptions): DescribeDedicatedClusterInstanceListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.dedicatedHostName)) {
    query['DedicatedHostName'] = request.dedicatedHostName;
  }
  if (!$isNull(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.instanceNetType)) {
    query['InstanceNetType'] = request.instanceNetType;
  }
  if (!$isNull(request.instanceStatus)) {
    query['InstanceStatus'] = request.instanceStatus;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDedicatedClusterInstanceList',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information of Tair (Redis OSS-compatible) instances deployed in a dedicated cluster.
 *
 * @description > If you want to query the information about Tair (Redis OSS-compatible) instances that are not deployed in a dedicated cluster, call the [DescribeInstanceAttribute](https://help.aliyun.com/document_detail/473779.html) operation.
 *
 * @param request DescribeDedicatedClusterInstanceListRequest
 * @return DescribeDedicatedClusterInstanceListResponse
 */
async function describeDedicatedClusterInstanceList(request: DescribeDedicatedClusterInstanceListRequest): DescribeDedicatedClusterInstanceListResponse {
  var runtime = new $RuntimeOptions{};
  return describeDedicatedClusterInstanceListWithOptions(request, runtime);
}

model DescribeEncryptionKeyRequest {
  encryptionKey?: string(name='EncryptionKey', description='The ID of the custom key. You can call the [DescribeEncryptionKeyList](https://help.aliyun.com/document_detail/473860.html) operation to query the ID of the key.', example='ad463061-992d-4195-8a94-ed63********'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeEncryptionKeyResponseBody = {
  creator?: string(name='Creator', description='The ID of the Alibaba Cloud account that is used to create the custom key.', example='17649847********'),
  deleteDate?: string(name='DeleteDate', description='The time when the custom key is expected to be deleted. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.

> If the return value is an empty string, the custom key cannot be automatically deleted.', example='2021-09-24T18:22:03Z'),
  description?: string(name='Description', description='The description of the custom key. By default, an empty string is returned.', example='testkey'),
  encryptionKey?: string(name='EncryptionKey', description='The ID of the custom key.', example='ad463061-992d-4195-8a94-ed63********'),
  encryptionKeyStatus?: string(name='EncryptionKeyStatus', description='The state of the custom key. Valid values:

*   **Enabled**: The custom key is available.
*   **Disabled**: The custom key is unavailable.', example='Enabled'),
  encryptionName?: string(name='EncryptionName', description='The encryption algorithm.', example='AES-CTR-256'),
  keyUsage?: string(name='KeyUsage', description='The purpose of the custom key. A value of `ENCRYPT/DECRYPT` indicates encryption and decryption.', example='ENCRYPT/DECRYPT'),
  materialExpireTime?: string(name='MaterialExpireTime', description='The time when the custom key expires. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.

> If the return value is an empty string, the custom key does not expire.', example='2021-09-24T18:22:03Z'),
  origin?: string(name='Origin', description='The source of the custom key. A value of **Aliyun_KMS** indicates [Key Management Service (KMS)](https://help.aliyun.com/document_detail/28935.html) of Alibaba Cloud.', example='Aliyun_KMS'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9A931CE5-C926-5E09-B0EC-6299C4A6****'),
  roleArn?: string(name='RoleArn', description='The Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role to which you want to grant permissions.', example='acs:ram::123456789012****:role/AliyunRdsInstanceEncryptionDefaultRole'),
}

model DescribeEncryptionKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEncryptionKeyResponseBody(name='body'),
}

/**
 * @summary Queries the details of a custom key for a Tair (Redis OSS-compatible) instance to use transparent data encryption (TDE).
 *
 * @description Before you call this operation, TDE must be enabled for the Tair (Redis OSS-compatible) instance by using a custom key. For more information, see [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html).
 * > For more information about TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 *
 * @param request DescribeEncryptionKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEncryptionKeyResponse
 */
async function describeEncryptionKeyWithOptions(request: DescribeEncryptionKeyRequest, runtime: $RuntimeOptions): DescribeEncryptionKeyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.encryptionKey)) {
    query['EncryptionKey'] = request.encryptionKey;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEncryptionKey',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of a custom key for a Tair (Redis OSS-compatible) instance to use transparent data encryption (TDE).
 *
 * @description Before you call this operation, TDE must be enabled for the Tair (Redis OSS-compatible) instance by using a custom key. For more information, see [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html).
 * > For more information about TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 *
 * @param request DescribeEncryptionKeyRequest
 * @return DescribeEncryptionKeyResponse
 */
async function describeEncryptionKey(request: DescribeEncryptionKeyRequest): DescribeEncryptionKeyResponse {
  var runtime = new $RuntimeOptions{};
  return describeEncryptionKeyWithOptions(request, runtime);
}

model DescribeEncryptionKeyListRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeEncryptionKeyListResponseBody = {
  keyIds?: {
    keyId?: [ string ](name='KeyId')
  }(name='KeyIds', description='The custom keys that are available in the region.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='10E2160B-959C-5C3E-BFE6-86EC5925****'),
}

model DescribeEncryptionKeyListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEncryptionKeyListResponseBody(name='body'),
}

/**
 * @summary Queries a list of custom keys used by Tair (Redis OSS-compatible) instances.
 *
 * @description *   You can specify a custom key when you call the [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html) operation to enable Transparent Data Encryption (TDE). You can call the DescribeEncryptionKeyList operation to query the custom keys that are in use. To create a custom key, you can call the [CreateKey](https://help.aliyun.com/document_detail/28947.html) operation of Key Management Service (KMS).
 * *   For more information about TDE and the usage notes of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 *
 * @param request DescribeEncryptionKeyListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEncryptionKeyListResponse
 */
async function describeEncryptionKeyListWithOptions(request: DescribeEncryptionKeyListRequest, runtime: $RuntimeOptions): DescribeEncryptionKeyListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEncryptionKeyList',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of custom keys used by Tair (Redis OSS-compatible) instances.
 *
 * @description *   You can specify a custom key when you call the [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html) operation to enable Transparent Data Encryption (TDE). You can call the DescribeEncryptionKeyList operation to query the custom keys that are in use. To create a custom key, you can call the [CreateKey](https://help.aliyun.com/document_detail/28947.html) operation of Key Management Service (KMS).
 * *   For more information about TDE and the usage notes of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 *
 * @param request DescribeEncryptionKeyListRequest
 * @return DescribeEncryptionKeyListResponse
 */
async function describeEncryptionKeyList(request: DescribeEncryptionKeyListRequest): DescribeEncryptionKeyListResponse {
  var runtime = new $RuntimeOptions{};
  return describeEncryptionKeyListWithOptions(request, runtime);
}

model DescribeEngineVersionRequest {
  instanceId?: string(name='InstanceId', description='The instance ID. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeEngineVersionResponseBody = {
  DBLatestMinorVersion?: {
    level?: string(name='Level', description='The version update level. Valid values:

*   **0**: regular
*   **1**: recommended
*   **2**: critical', example='0'),
    minorVersion?: string(name='MinorVersion', description='The version number.', example='7.0.1.4'),
    versionRelease?: {
      releaseInfo?: {
        releaseInfoList?: [ 
        {
          createTime?: string(name='CreateTime', description='The creation time of the instance.', example='2022-11-21T13:28Z'),
          level?: string(name='Level', description='The importance level.', example='0'),
          releaseNote?: string(name='ReleaseNote', description='The release notes.', example='netbank1022'),
          releaseNoteEn?: string(name='ReleaseNoteEn', description='The description of the minor versions to which the instance can be updated.', example='ReleaseNoteEn'),
          releaseVersion?: string(name='ReleaseVersion', description='The release version of EMR.', example='EMR-5.7.0'),
        }
      ](name='ReleaseInfoList')
      }(name='ReleaseInfo', description='The information about the minor versions.'),
      versionChangesLevel?: string(name='VersionChangesLevel', description='The version update level, which indicates how strongly the update is recommended. Valid values:

*   0: regular
*   1: recommended
*   2: critical', example='0'),
    }(name='VersionRelease', description='The version update path from the current minor version to the latest minor version of the instance, which is consistent with the version documentation. For more detailed information, you can directly refer to the release notes.'),
  }(name='DBLatestMinorVersion', description='The latest minor version to which the instance can be updated.'),
  DBVersionRelease?: string(name='DBVersionRelease', description='The release notes for the minor version of the instance, including the release date, minor version number, release type such as new feature, and description.', example='{\\\\"releaseInfo\\\\":{\\\\"createTime\\\\":\\\\"2021-07-27\\\\",\\\\"level\\\\":1,\\\\"releaseVersion\\\\":\\\\"0.5.4\\\\",\\\\"releaseNote\\\\":\\\\"功能更新：增强稳定性。\\\\"}],\\\\"versionChangesLevel\\\\":2}'),
  enableUpgradeMajorVersion?: boolean(name='EnableUpgradeMajorVersion', description='Indicates whether the instance major version can be upgraded. Valid values:

*   **true**: The major version can be upgraded.
*   **false**: The major version is the latest version and cannot be upgraded.

>  To upgrade the major version, call the [ModifyInstanceMajorVersion](https://help.aliyun.com/document_detail/473776.html) operation.', example='true'),
  enableUpgradeMinorVersion?: boolean(name='EnableUpgradeMinorVersion', description='Indicates whether the instance minor version can be updated. Valid values:

*   **true**: The minor version can be updated.
*   **false**: The minor version is the latest version and cannot be updated.

>  To update the minor version, call the [ModifyInstanceMinorVersion](https://help.aliyun.com/document_detail/473777.html) operation.', example='true'),
  engine?: string(name='Engine', description='The database engine. Valid values: **redis** and **memcache**.', example='redis'),
  isAutoUpgradeOpen?: string(name='IsAutoUpgradeOpen', description='Indicates whether automatic minor version update is enabled. Valid values:

*   **0**: Automatic minor version update is disabled.
*   **1**: Automatic minor version update is enabled.', example='0'),
  isLatestVersion?: boolean(name='IsLatestVersion', description='Indicates whether the instance uses the latest minor version. Valid values:

*   **true**
*   **false**', example='false'),
  isNewSSLMode?: string(name='IsNewSSLMode', description='Indicates whether Transport Layer Security (TLS) is enabled. Valid values:

*   **1**: TLS is enabled.
*   **0**: TLS is disabled.', example='1'),
  isOpenNGLB?: string(name='IsOpenNGLB', description='Indicates whether the NGLB mode is enabled. Valid values:

*   **0**: The NGLB mode is disabled.
*   **1**: The NGLB mode is enabled.', example='1'),
  isRedisCompatibleVersion?: string(name='IsRedisCompatibleVersion', description='Indicates whether the instance runs a Redis version.', example='1'),
  isSSLEnable?: string(name='IsSSLEnable', description='Indicates whether SSL is enabled. Valid values:

*   **1**: SSL is enabled.
*   **0**: TLS is disabled.', example='1'),
  majorVersion?: string(name='MajorVersion', description='The major version of the instance.', example='5.0'),
  minorVersion?: string(name='MinorVersion', description='The current minor version of the instance.', example='redis-5.0_0.5.0'),
  proxyLatestMinorVersion?: {
    level?: string(name='Level', description='The version update level. Valid values:

*   **0**: regular
*   **1**: recommended
*   **2**: critical', example='0'),
    minorVersion?: string(name='MinorVersion', description='The version number.', example='7.0.6'),
    versionRelease?: {
      releaseInfo?: {
        releaseInfoList?: [ 
        {
          createTime?: string(name='CreateTime', description='The time when the version was released.', example='2022-08-23T14:26:20Z'),
          level?: string(name='Level', description='The version update level. Valid values:

*   **0**: regular
*   **1**: recommended
*   **2**: critical', example='0'),
          releaseNote?: string(name='ReleaseNote', description='The release notes.', example='x x x x'),
          releaseNoteEn?: string(name='ReleaseNoteEn', description='The description of the minor versions to which the instance can be updated.', example='ReleaseNoteEn'),
          releaseVersion?: string(name='ReleaseVersion', description='The release version of EMR.', example='EMR-5.9.1'),
        }
      ](name='ReleaseInfoList')
      }(name='ReleaseInfo', description='The information about the minor versions.'),
      versionChangesLevel?: string(name='VersionChangesLevel', description='The version update level, which indicates how strongly the update is recommended. Valid values:

*   0: regular
*   1: recommended
*   2: critical', example='0'),
    }(name='VersionRelease', description='The version update path from the current minor version to the latest minor version of the instance, which is consistent with the version documentation. For more detailed information, you can directly refer to the release notes.'),
  }(name='ProxyLatestMinorVersion', description='The latest minor version to which the proxy node can be updated.'),
  proxyMinorVersion?: string(name='ProxyMinorVersion', description='The current minor version of the proxy node.

>  This parameter is returned only for cluster and read/write splitting instances.', example='6.6.0'),
  proxyVersionRelease?: string(name='ProxyVersionRelease', description='The release notes for the minor version of proxy nodes. The release notes include the release date, minor version number, release type such as new feature, and description.

>  This parameter is returned only for cluster and read/write splitting instances.', example='{\\\\"releaseInfo\\\\":[{\\\\"createTime\\\\":\\\\"2021-06-08\\\\",\\\\"level\\\\":0,\\\\"releaseVersion\\\\":\\\\"6.6.2\\\\",\\\\"releaseNote\\\\":\\\\"新特性：增加对部分内部命令的支持。\\\\"}],\\\\"versionChangesLevel\\\\":2}'),
  requestId?: string(name='RequestId', description='The request ID.', example='A52974D1-9D57-4805-86CC-92E6EDE8****'),
}

model DescribeEngineVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEngineVersionResponseBody(name='body'),
}

/**
 * @summary Queries the major version and minor version of a Tair (Redis OSS-compatible) instance and the release notes for minor versions.
 *
 * @description ## Debugging
 * [OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.](https://api.aliyun.com/#product=R-kvstore\\&api=DescribeEngineVersion\\&type=RPC\\&version=2015-01-01)
 *
 * @param request DescribeEngineVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEngineVersionResponse
 */
async function describeEngineVersionWithOptions(request: DescribeEngineVersionRequest, runtime: $RuntimeOptions): DescribeEngineVersionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEngineVersion',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the major version and minor version of a Tair (Redis OSS-compatible) instance and the release notes for minor versions.
 *
 * @description ## Debugging
 * [OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.](https://api.aliyun.com/#product=R-kvstore\\&api=DescribeEngineVersion\\&type=RPC\\&version=2015-01-01)
 *
 * @param request DescribeEngineVersionRequest
 * @return DescribeEngineVersionResponse
 */
async function describeEngineVersion(request: DescribeEngineVersionRequest): DescribeEngineVersionResponse {
  var runtime = new $RuntimeOptions{};
  return describeEngineVersionWithOptions(request, runtime);
}

model DescribeGlobalDistributeCacheRequest {
  globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance.', example='gr-bp14rkqrhac****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: string(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than **0**. Default value: **1**.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries to return each page.', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  subInstanceId?: string(name='SubInstanceId', description='The ID of the child instance that is attached to the distributed instance.', example='gr-bp1zcjlobkyrq****'),
}

model DescribeGlobalDistributeCacheResponseBody = {
  globalDistributeCaches?: [ 
    {
      globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance.', example='gr-bp14rkqrhac****'),
      status?: string(name='Status', description='The state of the distributed instance. Valid values:

*   **Normal**: The instance is normal.
*   **Changing**: The configurations of the instance are being changed.
*   **Creating**: The instance is being created.', example='Normal'),
      subInstances?: [ 
        {
          globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance.', example='gr-bp14rkqrhac****'),
          instanceClass?: string(name='InstanceClass', description='The instance type of the child instance. For more information, see the following topics:

*   [Standard DRAM-based instances](https://help.aliyun.com/document_detail/145228.html)
*   [Cluster DRAM-based instances](https://help.aliyun.com/document_detail/150458.html)
*   [Read/write splitting DRAM-based instances](https://help.aliyun.com/document_detail/150459.html)', example='redis.amber.logic.sharding.2g.2db.0rodb.6proxy.multithread'),
          instanceID?: string(name='InstanceID', description='The ID of the child instance.', example='r-bp1zxszhcgatnx****'),
          instanceStatus?: string(name='InstanceStatus', description='The state of the child instance. Valid values:

*   **Normal**: The instance is normal.
*   **Creating**: The instance is being created.
*   **Changing**: The configurations of the instance are being changed.
*   **Inactive**: The instance is disabled.
*   **Flushing**: The instance is being released.
*   **Released**: The instance is released.
*   **Transforming**: The billing method of the instance is changing.
*   **Unavailable**: The instance is suspended.
*   **Error**: The instance failed to be created.
*   **Migrating**: The instance is being migrated.
*   **BackupRecovering**: The instance is being restored from a backup.
*   **MinorVersionUpgrading**: The minor version of the instance is being updated.
*   **NetworkModifying**: The network type of the instance is being changed.
*   **SSLModifying**: The SSL certificate of the instance is being changed.
*   **MajorVersionUpgrading**: The major version of the instance is being upgraded. The instance remains available during the upgrade.

>  For more information about instance states, see [Instance states and impacts](https://help.aliyun.com/document_detail/200740.html).', example='Normal'),
          regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
        }
      ](name='SubInstances', description='Details of the child instances.'),
    }
  ](name='GlobalDistributeCaches', description='Details of the distributed instance.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='20'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F3F44BE3-5419-4B61-9BAC-E66E295A****'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries returned.', example='1'),
}

model DescribeGlobalDistributeCacheResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGlobalDistributeCacheResponseBody(name='body'),
}

/**
 * @summary Queries the details of a distributed Tair (Redis OSS-compatible) instance.
 *
 * @description ## Debugging
 * [OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.](https://api.aliyun.com/#product=R-kvstore\\&api=DescribeGlobalDistributeCache\\&type=RPC\\&version=2015-01-01)
 *
 * @param request DescribeGlobalDistributeCacheRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGlobalDistributeCacheResponse
 */
async function describeGlobalDistributeCacheWithOptions(request: DescribeGlobalDistributeCacheRequest, runtime: $RuntimeOptions): DescribeGlobalDistributeCacheResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.globalInstanceId)) {
    query['GlobalInstanceId'] = request.globalInstanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.subInstanceId)) {
    query['SubInstanceId'] = request.subInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeGlobalDistributeCache',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of a distributed Tair (Redis OSS-compatible) instance.
 *
 * @description ## Debugging
 * [OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.](https://api.aliyun.com/#product=R-kvstore\\&api=DescribeGlobalDistributeCache\\&type=RPC\\&version=2015-01-01)
 *
 * @param request DescribeGlobalDistributeCacheRequest
 * @return DescribeGlobalDistributeCacheResponse
 */
async function describeGlobalDistributeCache(request: DescribeGlobalDistributeCacheRequest): DescribeGlobalDistributeCacheResponse {
  var runtime = new $RuntimeOptions{};
  return describeGlobalDistributeCacheWithOptions(request, runtime);
}

model DescribeGlobalSecurityIPGroupRequest {
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-zsldxfiwjmti0kcm****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeGlobalSecurityIPGroupResponseBody = {
  globalSecurityIPGroup?: [ 
    {
      DBInstances?: [ string ](name='DBInstances', description='The IDs of the instances that are associated with the IP whitelist template.'),
      GIpList?: string(name='GIpList', description='The IP address in the IP whitelist template.

>  Multiple IP addresses are separated by commas (,).', example='125.38.177.62,221.197.232.185'),
      globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template.', example='test_123'),
      globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-zsldxfiwjmti0kcm****'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    }
  ](name='GlobalSecurityIPGroup', description='The information about the IP whitelist template.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2FF6158E-3394-4A90-B634-79C49184****'),
}

model DescribeGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Queries global IP whitelist templates.
 *
 * @param request DescribeGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGlobalSecurityIPGroupResponse
 */
async function describeGlobalSecurityIPGroupWithOptions(request: DescribeGlobalSecurityIPGroupRequest, runtime: $RuntimeOptions): DescribeGlobalSecurityIPGroupResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeGlobalSecurityIPGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries global IP whitelist templates.
 *
 * @param request DescribeGlobalSecurityIPGroupRequest
 * @return DescribeGlobalSecurityIPGroupResponse
 */
async function describeGlobalSecurityIPGroup(request: DescribeGlobalSecurityIPGroupRequest): DescribeGlobalSecurityIPGroupResponse {
  var runtime = new $RuntimeOptions{};
  return describeGlobalSecurityIPGroupWithOptions(request, runtime);
}

model DescribeGlobalSecurityIPGroupRelationRequest {
  DBClusterId?: string(name='DBClusterId', description='The instance ID.

This parameter is required.', example='r-t4n885e834f6****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeGlobalSecurityIPGroupRelationResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The instance ID.', example='r-t4n885e834f6****'),
  globalSecurityIPGroupRel?: [ 
    {
      GIpList?: string(name='GIpList', description='The IP address in the IP whitelist template.

>  Multiple IP addresses are separated by commas (,).', example='192.168.0.1,10.10.10.10'),
      globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template.', example='test_123'),
      globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-zsldxfiwjmti0kcm****'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    }
  ](name='GlobalSecurityIPGroupRel', description='The information about the associated global IP whitelist template.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9B7BFB11-C077-4FE3-B051-F69CEB******'),
}

model DescribeGlobalSecurityIPGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGlobalSecurityIPGroupRelationResponseBody(name='body'),
}

/**
 * @summary Queries information about the global IP whitelist templates associated with an instance.
 *
 * @param request DescribeGlobalSecurityIPGroupRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGlobalSecurityIPGroupRelationResponse
 */
async function describeGlobalSecurityIPGroupRelationWithOptions(request: DescribeGlobalSecurityIPGroupRelationRequest, runtime: $RuntimeOptions): DescribeGlobalSecurityIPGroupRelationResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeGlobalSecurityIPGroupRelation',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries information about the global IP whitelist templates associated with an instance.
 *
 * @param request DescribeGlobalSecurityIPGroupRelationRequest
 * @return DescribeGlobalSecurityIPGroupRelationResponse
 */
async function describeGlobalSecurityIPGroupRelation(request: DescribeGlobalSecurityIPGroupRelationRequest): DescribeGlobalSecurityIPGroupRelationResponse {
  var runtime = new $RuntimeOptions{};
  return describeGlobalSecurityIPGroupRelationWithOptions(request, runtime);
}

model DescribeHistoryMonitorValuesRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

>  You can query the monitoring data of the previous month. The maximum time range that you can specify for a query is seven days.

This parameter is required.', example='2022-11-06T00:30:00Z'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  intervalForHistory?: string(name='IntervalForHistory', description='The interval at which to collect monitoring data. Unit: minutes. Set the value to `01m`.

This parameter is required.', example='01m'),
  monitorKeys?: string(name='MonitorKeys', description='The monitoring metrics. Separate the metrics with commas (,). Take CpuUsage as an example:

*   Cluster or read/write splitting instances

    *   To query the overall CPU utilization of all data nodes, specify **CpuUsage$db**.
    *   To query the CPU utilization of a single data node, specify **CpuUsage** and NodeId.

*   Standard master-replica instances: Specify only **CpuUsage**.

For more information about monitoring metrics and their descriptions, see [Additional description of MonitorKeys](https://www.alibabacloud.com/help/zh/redis/developer-reference/api-r-kvstore-2015-01-01-describehistorymonitorvalues-redis#monitorKeys-note).

> 

*   This parameter is empty by default, which indicates that the UsedMemory and quotaMemory metrics are returned.

*   To ensure query efficiency, we recommend that you specify no more than five metrics for a single node at a time, and specify only a single metric when you query aggregate metrics.', example='memoryUsage'),
  nodeId?: string(name='NodeId', description='The ID of the node in the instance. You can set this parameter to query the data of a specified node.

*   This parameter is available only for read/write splitting or cluster instances of ApsaraDB for Redis.

*   You can call the [DescribeLogicInstanceTopology](https://help.aliyun.com/document_detail/473786.html) operation to query node IDs.', example='r-bp1zxszhcgatnx****-db-0#1679****'),
  nodeRole?: string(name='NodeRole', description='If you want to query the metrics of the read replicas in a cloud-native read/write splitting instance, you must set this parameter to **READONLY** and specify **NodeId**.

> In other cases, you do not need to specify this parameter or you can set this parameter to **MASTER**.', example='READONLY'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2022-11-06T00:00:00Z'),
}

model DescribeHistoryMonitorValuesResponseBody = {
  monitorHistory?: string(name='MonitorHistory', description='The monitoring information returned in the JSON format. For more information, see [View performance monitoring data](https://help.aliyun.com/document_detail/122091.html).

*   Only metrics whose values are not 0 are returned. This improves data transmission efficiency. Metrics that are not displayed are represented by the **0** default value.

*   The query result is aligned with the data aggregation frequency. If the specified time range to query is less than or equal to 10 minutes and the data is aggregated once every 5 seconds, query results are returned at an interval of 5 seconds. If the specified StartTime value does not coincide with a point in time for data aggregation, the system returns the latest point in time for data aggregation as the first point in time. For example, if you set the StartTime parameter to 2022-01-20T12:01:48Z, the first point in time returned is 2022-01-20T12:01:45Z.', example='"{\\\\"2022-11-06T00:00:00Z\\\\":{\\\\"memoryUsage\\\\":\\\\"6.67\\\\"},\\\\"2022-11-06T00:00:05Z\\\\":{\\\\"memoryUsage\\\\":\\\\"6.67\\\\"},\\\\"2022-11-06T00:00:10Z\\\\":{\\\\"memoryUsage\\\\":\\\\"6.67\\\\"},\\\\"2022-11-06T00:00:15Z\\\\":{\\\\"memoryUsage\\\\":\\\\"6.67\\\\"},\\\\"2022-11-06T00:00:20Z\\\\":{\\\\"memoryUsage\\\\":\\\\"6.67\\\\"},\\\\"2022-11-06T00:00:25Z\\\\":{\\\\"memoryUsage\\\\":\\\\"6.67\\\\"}}"'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F0997EE8-F4C2-4503-9168-85177ED7****'),
}

model DescribeHistoryMonitorValuesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHistoryMonitorValuesResponseBody(name='body'),
}

/**
 * @summary Queries the performance monitoring data of an ApsaraDB for Redis instance.
 *
 * @description You can also query the performance monitoring data of an instance in the ApsaraDB for Redis console. For more information, see [Metrics](https://help.aliyun.com/document_detail/43887.html).
 *
 * @param request DescribeHistoryMonitorValuesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHistoryMonitorValuesResponse
 */
async function describeHistoryMonitorValuesWithOptions(request: DescribeHistoryMonitorValuesRequest, runtime: $RuntimeOptions): DescribeHistoryMonitorValuesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.intervalForHistory)) {
    query['IntervalForHistory'] = request.intervalForHistory;
  }
  if (!$isNull(request.monitorKeys)) {
    query['MonitorKeys'] = request.monitorKeys;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.nodeRole)) {
    query['NodeRole'] = request.nodeRole;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeHistoryMonitorValues',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the performance monitoring data of an ApsaraDB for Redis instance.
 *
 * @description You can also query the performance monitoring data of an instance in the ApsaraDB for Redis console. For more information, see [Metrics](https://help.aliyun.com/document_detail/43887.html).
 *
 * @param request DescribeHistoryMonitorValuesRequest
 * @return DescribeHistoryMonitorValuesResponse
 */
async function describeHistoryMonitorValues(request: DescribeHistoryMonitorValuesRequest): DescribeHistoryMonitorValuesResponse {
  var runtime = new $RuntimeOptions{};
  return describeHistoryMonitorValuesWithOptions(request, runtime);
}

model DescribeHistoryTasksRequest {
  fromExecTime?: int32(name='FromExecTime', description='The minimum execution duration of a task. This parameter is used to filter tasks whose execution duration is longer than the minimum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed.', example='0'),
  fromStartTime?: string(name='FromStartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The start time can be up to 30 days earlier than the current time.

This parameter is required.', example='2022-01-02T11:31:03Z'),
  instanceId?: string(name='InstanceId', description='The instance ID. This parameter is empty by default, which indicates that you can specify an unlimited number of instance IDs. Separate multiple instance IDs with commas (,). You can specify up to 30 instance IDs.', example='r-uf62br2491p5l****'),
  instanceType?: string(name='InstanceType', description='Set the value to Instance.', example='Instance'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 10 to 100. Default value: 10.', example='10'),
  regionId?: string(name='RegionId', description='The region ID. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.', example='cn-beijing'),
  resourceOwnerAccount?: long(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  status?: string(name='Status', description='The task status. Valid values:

*   **Scheduled**
*   **Running**
*   **Succeed**
*   **Failed**
*   **Cancelling**
*   **Canceled**
*   **Waiting**

>  This parameter is empty by default, which indicates that tasks in all states are queried. Separate multiple states with commas (,).', example='Scheduled'),
  taskId?: string(name='TaskId', description='The task ID. This parameter is empty by default, which indicates that you can specify an unlimited number of task IDs. Separate multiple task IDs with commas (,). You can specify up to 30 task IDs.', example='t-83br18hloy3faf****'),
  taskType?: string(name='TaskType', description='The task type. This parameter is empty by default, which indicates that you can specify an unlimited number of task types.

*   **ModifyInsSpec**
*   **DeleteInsNode**
*   **AddInsNode**
*   **HaSwitch**
*   **RestartIns**
*   **CreateIns**
*   **ModifyInsConfig**

>  Separate multiple task types with commas (,).', example='ModifyInsSpec'),
  toExecTime?: int32(name='ToExecTime', description='The maximum execution duration of a task. This parameter is used to filter tasks whose execution duration is shorter than or equal to the maximum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed.', example='0'),
  toStartTime?: string(name='ToStartTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Only tasks that have a start time earlier than or equal to the time specified by this parameter are queried.

This parameter is required.', example='2022-03-02T11:31:03Z'),
}

model DescribeHistoryTasksResponseBody = {
  items?: [ 
    {
      actionInfo?: string(name='ActionInfo', description='A set of allowed actions that can be taken on the task. The system matches the current step name and status of the task to the available actions specified by ActionInfo. If no matching action is found, the current status of the task does not support any action. Example:

    {"steps": [
        {
          "step_name": "exec_task", // The name of the step, which matches CurrentStepName.
          "action_info": {    // The actions supported for this step.
            "Waiting": [      // The status, which matches Status.
              "modifySwitchTime" // The action. Multiple actions are supported.
            ]
          }
        },
        {
          "step_name": "init_task", // The name of the step.
          "action_info": {    // The actions supported for this step.
            "Running": [      // The status.
              "cancel",       // The action.
              "pause"
            ]
          }
        }
      ]
    }

The system may support the following actions:

*   **retry**
*   **cancel**
*   **modifySwitchTime**: changes the switching or restoration time.', example='{\\\\"steps\\\\":[{\\\\"action_info\\\\":{\\\\"Waiting\\\\":[\\\\"modifySwitchTime\\\\"]},\\\\"step_name\\\\":\\\\"exec_task\\\\"}]}'),
      callerSource?: string(name='CallerSource', description='The ID of the user who made the request. If CallerSource is set to User, CallerUid indicates the unique ID (UID) of the user.', example='141345906006****'),
      callerUid?: string(name='CallerUid', description='The request source. Valid values:

*   **System**
*   **User**', example='User'),
      currentStepName?: string(name='CurrentStepName', description='The name of the current step. If this parameter is left empty, the task is not started.', example='exec_task'),
      dbType?: string(name='DbType', description='The database type. The return value is redis.', example='redis'),
      endTime?: string(name='EndTime', description='The end time of the task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-02-03T12:06:17Z'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='r-bp1zxszhcgatnx****'),
      instanceName?: string(name='InstanceName', description='The instance name.', example='dba-tair-test-qcloud'),
      instanceType?: string(name='InstanceType', description='The instance type. The return value is Instance.', example='Instance'),
      product?: string(name='Product', description='The product. The return value is kvstore.', example='kvstore'),
      progress?: float(name='Progress', description='The task progress. Valid values: 0 to 100.', example='79.0'),
      reasonCode?: string(name='ReasonCode', description='The reason why the current task was initiated.', example='UpgradeMinorVersion'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-shanghai'),
      remainTime?: int32(name='RemainTime', description='The estimated amount of time remaining to complete the task. Unit: seconds. A value of 0 indicates that the task is completed.', example='1000'),
      startTime?: string(name='StartTime', description='The start time of the task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-02-03T11:31:03Z'),
      status?: string(name='Status', description='The task status.

*   **Scheduled**
*   **Running**
*   **Succeed**
*   **Failed**
*   **Cancelling**
*   **Canceled**
*   **Waiting**', example='Running'),
      taskDetail?: string(name='TaskDetail', description='The task details. The details vary based on the task type.', example='{\\\\"callerUid\\\\":\\\\"test\\\\"}'),
      taskId?: string(name='TaskId', description='The task ID.', example='t-83br18hloy3faf****'),
      taskType?: string(name='TaskType', description='The task type.

*   **ModifyInsSpec**
*   **DeleteInsNode**
*   **AddInsNode**
*   **HaSwitch**
*   **RestartIns**
*   **CreateIns**
*   **ModifyInsConfig**', example='ModifyInsSpec'),
      uid?: string(name='Uid', description='The ID of the user to which the resources belong.', example='141345906006****'),
    }
  ](name='Items', description='The queried task objects.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
  totalCount?: int32(name='TotalCount', description='The total number of tasks that meet these constraints without taking pagination into account.', example='5'),
}

model DescribeHistoryTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHistoryTasksResponseBody(name='body'),
}

/**
 * @summary Queries a list of tasks in the task center.
 *
 * @param request DescribeHistoryTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHistoryTasksResponse
 */
async function describeHistoryTasksWithOptions(request: DescribeHistoryTasksRequest, runtime: $RuntimeOptions): DescribeHistoryTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.fromExecTime)) {
    query['FromExecTime'] = request.fromExecTime;
  }
  if (!$isNull(request.fromStartTime)) {
    query['FromStartTime'] = request.fromStartTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!$isNull(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!$isNull(request.toExecTime)) {
    query['ToExecTime'] = request.toExecTime;
  }
  if (!$isNull(request.toStartTime)) {
    query['ToStartTime'] = request.toStartTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeHistoryTasks',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of tasks in the task center.
 *
 * @param request DescribeHistoryTasksRequest
 * @return DescribeHistoryTasksResponse
 */
async function describeHistoryTasks(request: DescribeHistoryTasksRequest): DescribeHistoryTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeHistoryTasksWithOptions(request, runtime);
}

model DescribeInstanceAttributeRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeInstanceAttributeResponseBody = {
  instances?: {
    DBInstanceAttribute?: [ 
    {
      architectureType?: string(name='ArchitectureType', description='The architecture of the instance. Valid values:

*   **cluster**: cluster architecture
*   **standard**: standard architecture
*   **rwsplit**: read/write splitting architecture', example='standard'),
      auditLogRetention?: string(name='AuditLogRetention', description='The retention period of audit logs. Unit: day. A value of 0 indicates that the audit log feature is disabled. For information about how to enable the feature, see [Enable the audit log feature](https://help.aliyun.com/document_detail/102015.html).', example='15'),
      autoSecondaryZone?: boolean(name='AutoSecondaryZone', description='Indicates whether a secondary zone is automatically allocated.

*   **true**
*   **false**', example='true'),
      availabilityValue?: string(name='AvailabilityValue', description='The availability metric of the current month.', example='100%'),
      backupLogStartTime?: string(name='BackupLogStartTime', description='The earliest point in time to which data can be restored. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.

> 

*   This parameter is returned only when the data flashback feature is enabled for the instance. For more information, see [Restore data to a point in time by using the data flashback feature](https://help.aliyun.com/document_detail/148479.html).

*   When you call the [RestoreInstance](https://help.aliyun.com/document_detail/473824.html) operation to implement data flashback, you can obtain the earliest point in time for data flashback from the return value of this parameter and set the **RestoreTime** parameter to this point in time.', example='2021-07-06T05:49:55Z'),
      bandwidth?: long(name='Bandwidth', description='The bandwidth of the instance. Unit: Mbit/s.', example='10'),
      capacity?: long(name='Capacity', description='The storage capacity of the instance. Unit: MB.', example='1024'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
      cloudType?: string(name='CloudType', description='This parameter is returned only when the instance is in a cloud box.', example='cloudbox'),
      config?: string(name='Config', description='The parameter configurations of the instance in the JSON format. For more information, see [Parameter descriptions](https://help.aliyun.com/document_detail/43885.html). You can use the [DescribeAuditLogConfig](https://help.aliyun.com/document_detail/473830.html) operation to query audit log configurations.', example='{\\\\"EvictionPolicy\\\\":\\\\"volatile-lru\\\\",\\\\"hash-max-ziplist-entries\\\\":512,\\\\"zset-max-ziplist-entries\\\\":128,\\\\"zset-max-ziplist-value\\\\":64,\\\\"set-max-intset-entries\\\\":512,\\\\"hash-max-ziplist-value\\\\":64}'),
      connectionDomain?: string(name='ConnectionDomain', description='The internal endpoint of the instance.', example='r-bp1d72gwl41z7f****.redis.rds.aliyuncs.com'),
      connections?: long(name='Connections', description='The maximum number of connections supported by the instance.', example='10000'),
      createTime?: string(name='CreateTime', description='The time when the instance was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-03-06T10:42:03Z'),
      endTime?: string(name='EndTime', description='The time when the subscription expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2019-04-06T10:42:03Z'),
      engine?: string(name='Engine', description='The database engine of the instance. The return value is **Redis**.', example='Redis'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values: **2.8**, **4.0**, **5.0**, **6.0**, and **7.0**.', example='4.0'),
      globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance to which the instance belongs.

>  This parameter is returned only when the Tair (Redis OSS-compatible) instance is a child instance of a distributed instance.', example='gr-bp14rkqrhac****'),
      hasRenewChangeOrder?: string(name='HasRenewChangeOrder', description='Indicates whether your Alibaba Cloud account has pending orders for renewal and configuration change. Valid values:

*   **true**
*   **false**', example='false'),
      instanceClass?: string(name='InstanceClass', description='The instance type. For more information, see [Instance types](https://help.aliyun.com/document_detail/107984.html).', example='redis.master.small.default'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1d72gwl41z7f****'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='apitest'),
      instanceReleaseProtection?: boolean(name='InstanceReleaseProtection', description='Indicates whether the release protection feature is enabled for the instance. Valid values:

*   **true**
*   **false**', example='false'),
      instanceStatus?: string(name='InstanceStatus', description='The state of the instance. Valid values:

*   **Normal**: The instance is normal.
*   **Creating**: The instance is being created.
*   **Changing**: The configurations of the instance are being changed.
*   **Inactive**: The instance is disabled.
*   **Flushing**: The instance is being released.
*   **Released**: The instance is released.
*   **Transforming**: The billing method of the instance is being changed.
*   **Unavailable**: The instance is unavailable.
*   **Error**: The instance failed to be created.
*   **Migrating**: The instance is being migrated.
*   **BackupRecovering**: The instance is being restored from a backup.
*   **MinorVersionUpgrading**: The minor version of the instance is being updated.
*   **NetworkModifying**: The network type of the instance is being changed.
*   **SSLModifying**: The SSL configurations of the instance are being changed.
*   **MajorVersionUpgrading**: The major version of the instance is being upgraded. The instance remains accessible during the upgrade.

>  For more information about instance states, see [Instance states and impacts](https://help.aliyun.com/document_detail/200740.html).', example='Normal'),
      instanceType?: string(name='InstanceType', description='The database engine of the instance. Valid values:

*   **Tair**
*   **Redis**
*   **Memcache**', example='Redis'),
      isOrderCompleted?: boolean(name='IsOrderCompleted', description='Indicates whether the order for instance configuration change has reached the final state. Valid values:

*   **true**: The configuration change has been completed or has not been performed.
*   **false**: The configurations of the instance are being changed.', example='true'),
      isRds?: boolean(name='IsRds', description='Indicates whether the instance is managed by ApsaraDB RDS. Valid values:

*   **true**
*   **false**', example='true'),
      isSupportTDE?: boolean(name='IsSupportTDE', description='Indicates whether the transparent data encryption (TDE) feature is supported for the instance. Valid values:

*   **true**: This feature is supported only for DRAM-based classic instances.
*   **false**: This feature is not supported.', example='true'),
      maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window. The time is in the *HH:mmZ* format. The time is displayed in UTC.', example='22:00Z'),
      maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window. The time is in the *HH:mmZ* format. The time is displayed in UTC.', example='18:00Z'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **CLASSIC**
*   **VPC**', example='CLASSIC'),
      nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **double**: The instance contains a master node and a replica node.
*   **single**: The instance is a standalone instance.', example='double'),
      packageType?: string(name='PackageType', description='The plan type. Valid values:

*   **standard**: standard plan.
*   **customized**: custom plan. This plan type is phased out.', example='standard'),
      port?: long(name='Port', description='The service port of the instance.', example='6379'),
      privateIp?: string(name='PrivateIp', description='The private IP address of the instance.

>  This parameter is not returned when the instance is deployed in the classic network.', example='172.16.49.***'),
      QPS?: long(name='QPS', description='The expected maximum queries per second (QPS).', example='100000'),
      readOnlyCount?: int32(name='ReadOnlyCount', description='The number of read replicas. This parameter is available only for read/write splitting instances that use cloud disks.', example='5'),
      realInstanceClass?: string(name='RealInstanceClass', description='If the instance is a cluster instance that uses cloud disks, this parameter indicates the actual instance type of individual shards in the instance. The InstanceClass parameter indicates the virtual instance type.

>  To query fees for instances of the instance type, you can specify the instance type that is returned by this parameter in the [DescribePrice](https://help.aliyun.com/document_detail/473807.html) operation.', example='tair.rdb.with.proxy.1g'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      replicaCount?: int32(name='ReplicaCount', description='The number of replica nodes in the primary zone.

>  The **ReplicaCount** and **SlaveReplicaCount** parameters are applicable only to cloud-native instances. If the instance is a cluster instance, the preceding parameters indicate the number of replica nodes **per node** in the primary and secondary zones of the instance.', example='1'),
      replicaId?: string(name='ReplicaId', description='The ID of the replica node.', example='bls-awxxxxxxxxxxxxx'),
      replicationMode?: string(name='ReplicationMode', description='The architecture of the replica node. Valid values:

*   **master-slave**: the standard master-replica architecture.
*   **cluster**: the cluster architecture, which includes the read/write splitting instances and cluster instances.', example='master-slave'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-acfmyiu4ekp****'),
      secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the secondary zone.

>  This parameter is returned only if the instance has a secondary zone ID.', example='cn-hongkong-h'),
      securityIPList?: string(name='SecurityIPList', description='The IP addresses in the whitelist.', example='127.0.0.1'),
      shardCount?: int32(name='ShardCount', description='The number of shards. This parameter is available only for instances that are purchased on the China site (aliyun.com).', example='2'),
      slaveReadOnlyCount?: long(name='SlaveReadOnlyCount', description='The number of read replicas in the secondary zone. This parameter is returned only after read/write splitting is enabled for the instance across multiple zones.', example='2'),
      slaveReplicaCount?: int32(name='SlaveReplicaCount', description='The number of replica nodes in the secondary zone.', example='1'),
      storage?: string(name='Storage', description='The storage capacity of the cloud disk.', example='50'),
      storageType?: string(name='StorageType', description='The storage type.', example='essd_pl1'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='tagkey'),
          value?: string(name='Value', description='The tag value.', example='tagvalue'),
        }
      ](name='Tag')
      }(name='Tags', description='Details about the tags.'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-bp1e7clcw529l773d****'),
      vpcAuthMode?: string(name='VpcAuthMode', description='Indicates whether password authentication is enabled. Valid values:

*   **Open**: Password authentication is enabled.
*   **Close**: Password authentication is disabled and [password-free access](https://help.aliyun.com/document_detail/85168.html) is enabled.', example='Open'),
      vpcCloudInstanceId?: string(name='VpcCloudInstanceId', description='The ID of the instance in the VPC.', example='r-bp1d72gwl41z7f****'),
      vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-bp1nme44gek34slfc****'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hongkong-b'),
      zoneType?: string(name='ZoneType', description='The deployment type of the instance. Valid values:

*   **singlezone**: The instance is deployed in a single zone.
*   **doublezone**: The instance is deployed in two zones of the same region.', example='singlezone'),
    }
  ](name='DBInstanceAttribute')
  }(name='Instances', description='Details about the instances.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CA40C261-EB72-4EDA-AC57-958722162595'),
}

model DescribeInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the attribute of Tair (Redis OSS-compatible) instances.
 *
 * @param request DescribeInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceAttributeResponse
 */
async function describeInstanceAttributeWithOptions(request: DescribeInstanceAttributeRequest, runtime: $RuntimeOptions): DescribeInstanceAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the attribute of Tair (Redis OSS-compatible) instances.
 *
 * @param request DescribeInstanceAttributeRequest
 * @return DescribeInstanceAttributeResponse
 */
async function describeInstanceAttribute(request: DescribeInstanceAttributeRequest): DescribeInstanceAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceAttributeWithOptions(request, runtime);
}

model DescribeInstanceAutoRenewalAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

> By default, the system checks whether auto-renewal is enabled for all instances.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer greater than **0**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**.

> The default value is **30**.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeInstanceAutoRenewalAttributeResponseBody = {
  items?: {
    item?: [ 
    {
      autoRenew?: string(name='AutoRenew', description='Indicates whether auto-renewal is enabled. Valid values:

*   **true**: Auto-renewal is enabled.
*   **false**: Auto-renewal is disabled.', example='true'),
      DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
      duration?: int32(name='Duration', description='The auto-renewal period. Unit: months.', example='1'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-shanghai'),
    }
  ](name='Item')
  }(name='Items', description='Details of the auto-renewal information for the instance.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of entries returned on the current page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2B17D708-1D6D-49F3-B6D7-478371DD****'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned entries.', example='1'),
}

model DescribeInstanceAutoRenewalAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceAutoRenewalAttributeResponseBody(name='body'),
}

/**
 * @summary Queries whether auto-renewal is enabled for a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeInstanceAutoRenewalAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceAutoRenewalAttributeResponse
 */
async function describeInstanceAutoRenewalAttributeWithOptions(request: DescribeInstanceAutoRenewalAttributeRequest, runtime: $RuntimeOptions): DescribeInstanceAutoRenewalAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceAutoRenewalAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether auto-renewal is enabled for a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeInstanceAutoRenewalAttributeRequest
 * @return DescribeInstanceAutoRenewalAttributeResponse
 */
async function describeInstanceAutoRenewalAttribute(request: DescribeInstanceAutoRenewalAttributeRequest): DescribeInstanceAutoRenewalAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceAutoRenewalAttributeWithOptions(request, runtime);
}

model DescribeInstanceConfigRequest {
  instanceId?: string(name='InstanceId', description='The instance ID. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeInstanceConfigResponseBody = {
  config?: string(name='Config', description='The parameter settings of the instance. For more information, see [Parameter overview and configuration guide](https://help.aliyun.com/document_detail/43885.html).', example='{\\\\"EvictionPolicy\\\\":\\\\"volatile-lru\\\\",\\\\"hash-max-ziplist-entries\\\\":512,\\\\"zset-max-ziplist-entries\\\\":128,\\\\"list-max-ziplist-entries\\\\":512,\\\\"list-max-ziplist-value\\\\":64,\\\\"zset-max-ziplist-value\\\\":64,\\\\"set-max-intset-entries\\\\":512,\\\\"hash-max-ziplist-value\\\\":64}'),
  paramNoLooseSentinelEnabled?: string(name='ParamNoLooseSentinelEnabled', description='The Sentinel-compatible mode, which is applicable to non-cluster instances. For more information about the parameter, see the relevant documentation.', example='****'),
  paramNoLooseSentinelPasswordFreeAccess?: string(name='ParamNoLooseSentinelPasswordFreeAccess', description='Indicates whether Sentinel commands can be run without requiring a password when the Sentinel mode is enabled. Valid values: Valid values: yes and no. Default value: no. After you set this parameter to yes, you can run Sentinel commands in a virtual private cloud (VPC) without the need to enable the password-free access feature.', example='no'),
  paramNoLooseSentinelPasswordFreeCommands?: string(name='ParamNoLooseSentinelPasswordFreeCommands', description='After you enable the Sentinel mode and set the ParamNoLooseSentinelPasswordFreeAccess parameter to yes, you can use this parameter to specify an additional list of commands that can be run without requiring a password. By default, this parameter is empty. After you configure this parameter, you can run the specified commands without a password on any connection. Proceed with caution. The commands must be written in lowercase letters. Multiple commands are separated by commas (,).', example='****'),
  paramReplMode?: string(name='ParamReplMode', description='The synchronization mode.

*   **semisync**
*   **async**', example='async'),
  paramReplTimeout?: string(name='ParamReplTimeout', description='The degradation threshold time of the semi-synchronous replication mode. This parameter is required only when semi-synchronous replication is enabled. Unit: milliseconds. Valid values: 10 to 60000.', example='****'),
  paramSentinelCompatEnable?: string(name='ParamSentinelCompatEnable', description='The Sentinel-compatible mode, which is applicable to cluster instances in proxy mode or read/write splitting instances. For more information about the parameter, see the relevant documentation.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='4E2C08F6-2D11-4ECD-9A4C-27EF2D3D****'),
}

model DescribeInstanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceConfigResponseBody(name='body'),
}

/**
 * @summary Queries the default parameter configurations of a Tair (Redis OSS-compatible) instance.
 *
 * @description This operation is available only for instances that use cloud disks.
 * > You can call the [DescribeParameters](https://help.aliyun.com/document_detail/473847.html) operation to query the parameter settings of instances that use local disks.
 *
 * @param request DescribeInstanceConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceConfigResponse
 */
async function describeInstanceConfigWithOptions(request: DescribeInstanceConfigRequest, runtime: $RuntimeOptions): DescribeInstanceConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceConfig',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the default parameter configurations of a Tair (Redis OSS-compatible) instance.
 *
 * @description This operation is available only for instances that use cloud disks.
 * > You can call the [DescribeParameters](https://help.aliyun.com/document_detail/473847.html) operation to query the parameter settings of instances that use local disks.
 *
 * @param request DescribeInstanceConfigRequest
 * @return DescribeInstanceConfigResponse
 */
async function describeInstanceConfig(request: DescribeInstanceConfigRequest): DescribeInstanceConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceConfigWithOptions(request, runtime);
}

model DescribeInstanceSSLRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeInstanceSSLResponseBody = {
  certCommonName?: string(name='CertCommonName', description='The common name of the CA certificate. The default value is the internal endpoint of the instance.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
  certDownloadURL?: string(name='CertDownloadURL', description='The download URL of the CA certificate.', example='https://apsaradb-public.oss-ap-sout****-1.aliy****.com/ApsaraDB-CA-Chain.zip'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='02260F96-913E-4655-9BA5-A3651CAF****'),
  SSLEnabled?: string(name='SSLEnabled', description='The status of the TLS (SSL) encryption feature. Valid values:

*   **Enable**: SSL encryption is enabled.
*   **Disable**: SSL encryption is disabled.', example='Enable'),
  SSLExpiredTime?: string(name='SSLExpiredTime', description='The time when the CA certificate expires.', example='2020-08-05T09:05:53Z'),
}

model DescribeInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSSLResponseBody(name='body'),
}

/**
 * @summary Queries whether TLS (SSL) encryption is enabled for an instance.
 *
 * @description SSL encryption is supported for Tair (Redis OSS-compatible) 2.8 standard master-replica instances, Tair (Redis OSS-compatible) 2.8 master-replica cluster instances, and Tair (Redis OSS-compatible) 4.0 master-replica cluster instances. You can enable SSL encryption to enhance data transmission security.
 * You can use one of the following methods to enable or disable SSL encryption or update the SSL certificate for a Tair (Redis OSS-compatible) instance:
 * *   Call the [ModifyInstanceSSL](https://help.aliyun.com/document_detail/473838.html) operation.
 * *   Enable or disable SSL encryption or update the SSL certificate in the Tair (Redis OSS-compatible) console. For more information, see [Configure SSL encryption](https://help.aliyun.com/document_detail/84898.html).
 * > After SSL encryption is enabled, the instance may respond slower.
 *
 * @param request DescribeInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSSLResponse
 */
async function describeInstanceSSLWithOptions(request: DescribeInstanceSSLRequest, runtime: $RuntimeOptions): DescribeInstanceSSLResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceSSL',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether TLS (SSL) encryption is enabled for an instance.
 *
 * @description SSL encryption is supported for Tair (Redis OSS-compatible) 2.8 standard master-replica instances, Tair (Redis OSS-compatible) 2.8 master-replica cluster instances, and Tair (Redis OSS-compatible) 4.0 master-replica cluster instances. You can enable SSL encryption to enhance data transmission security.
 * You can use one of the following methods to enable or disable SSL encryption or update the SSL certificate for a Tair (Redis OSS-compatible) instance:
 * *   Call the [ModifyInstanceSSL](https://help.aliyun.com/document_detail/473838.html) operation.
 * *   Enable or disable SSL encryption or update the SSL certificate in the Tair (Redis OSS-compatible) console. For more information, see [Configure SSL encryption](https://help.aliyun.com/document_detail/84898.html).
 * > After SSL encryption is enabled, the instance may respond slower.
 *
 * @param request DescribeInstanceSSLRequest
 * @return DescribeInstanceSSLResponse
 */
async function describeInstanceSSL(request: DescribeInstanceSSLRequest): DescribeInstanceSSLResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceSSLWithOptions(request, runtime);
}

model DescribeInstanceTDEStatusRequest {
  instanceId?: string(name='InstanceId', description='The ID of the Tair (Redis OSS-compatible) instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query instance IDs.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeInstanceTDEStatusResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
  TDEStatus?: string(name='TDEStatus', description='Indicates whether TDE is enabled. Valid values:

*   **Enabled**: TDE is enabled.
*   **Disable**: TDE is disabled.', example='Enabled'),
}

model DescribeInstanceTDEStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceTDEStatusResponseBody(name='body'),
}

/**
 * @summary Queries whether transparent data encryption (TDE) is enabled for a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about TDE and the usage notes of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 * >  You can call the [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html) to enable or disable TDE.
 *
 * @param request DescribeInstanceTDEStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceTDEStatusResponse
 */
async function describeInstanceTDEStatusWithOptions(request: DescribeInstanceTDEStatusRequest, runtime: $RuntimeOptions): DescribeInstanceTDEStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceTDEStatus',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether transparent data encryption (TDE) is enabled for a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about TDE and the usage notes of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 * >  You can call the [ModifyInstanceTDE](https://help.aliyun.com/document_detail/473859.html) to enable or disable TDE.
 *
 * @param request DescribeInstanceTDEStatusRequest
 * @return DescribeInstanceTDEStatusResponse
 */
async function describeInstanceTDEStatus(request: DescribeInstanceTDEStatusRequest): DescribeInstanceTDEStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstanceTDEStatusWithOptions(request, runtime);
}

model DescribeInstancesRequest {
  architectureType?: string(name='ArchitectureType', description='The architecture of the instance. Valid values:

*   **cluster**: cluster architecture
*   **standard**: standard architecture
*   **rwsplit**: read/write splitting architecture', example='standard'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
  editionType?: string(name='EditionType', description='The edition of the instance. Valid values:

*   **Community**: Redis Open-Source Edition
*   **Enterprise**: Tair (Enterprise Edition)', example='Enterprise'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values: **2.8**, **4.0**, **5.0**, **6.0**, and **7.0**.

Enumerated values:

*   1.0
*   2.8
*   4.0
*   5.0
*   6.0
*   7.0', example='4.0'),
  expired?: string(name='Expired', description='Specifies whether the instance has expired. Valid values:

*   **true**: The instance has expired.
*   **false**: The instance has not expired.', example='false'),
  globalInstance?: boolean(name='GlobalInstance', description='Specifies whether to return the child instances of distributed instances. Valid values:

*   **true**: Only child instances are returned.
*   **false**: Child instances are not returned.', example='true'),
  instanceClass?: string(name='InstanceClass', description='The instance type of the instance. For more information, see [Instance types](https://help.aliyun.com/document_detail/107984.html).', example='redis.master.small.default'),
  instanceIds?: string(name='InstanceIds', description='The IDs of the instances that you want to query.

>  If you want to specify multiple instance IDs, separate the instance IDs with commas (,). You can specify a maximum of 30 instance IDs in a single request.', example='r-bp1zxszhcgatnx****'),
  instanceStatus?: string(name='InstanceStatus', description='The state of the instance. Valid values:

*   **Normal**: The instance is normal.
*   **Creating**: The instance is being created.
*   **Changing**: The configurations of the instance are being changed.
*   **Inactive**: The instance is disabled.
*   **Flushing**: The instance is being released.
*   **Released**: The instance is released.
*   **Transforming**: The billing method of the instance is being changed.
*   **Unavailable**: The instance is suspended.
*   **Error**: The instance failed to be created.
*   **Migrating**: The instance is being migrated.
*   **BackupRecovering**: The instance is being restored from a backup.
*   **MinorVersionUpgrading**: The minor version of the instance is being updated.
*   **NetworkModifying**: The network type of the instance is being changed.
*   **SSLModifying**: The SSL certificate of the instance is being changed.
*   **MajorVersionUpgrading**: The major version of the instance is being upgraded. The instance remains accessible during the upgrade.

> For more information about instance states, see [Instance states and impacts](https://help.aliyun.com/document_detail/200740.html).', example='Normal'),
  instanceType?: string(name='InstanceType', description='The database engine. Valid values:

*   **Tair**: Tair (Enterprise Edition)
*   **Redis**: Redis Open-Source Edition
*   **Memcache**', example='Redis'),
  networkType?: string(name='NetworkType', description='The network type. Valid values:

*   **CLASSIC**
*   **VPC**', example='CLASSIC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page **1**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum value: **50**. Default value: **30**.', example='10'),
  privateIp?: string(name='PrivateIp', description='The private IP address of the instance.', example='172.16.49.***'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

> When you call this operation and specify the **Tag** parameter, you must also specify this parameter.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.

> You can query resource group IDs by using the Tair (Redis OSS-compatible) console or by calling the [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html) operation. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  searchKey?: string(name='SearchKey', description='The keyword used for fuzzy search. The keyword can be based on an instance name or an instance ID.', example='apitest'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. A tag is a key-value pair.

>  A maximum of five key-value pairs can be specified at a time.', example='Storage type'),
      value?: string(name='Value', description='The tag value.', example='Local disk'),
    }
  ](name='Tag', description='The tags of the instance.'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hongkong-b'),
}

model DescribeInstancesResponseBody = {
  instances?: {
    KVStoreInstance?: [ 
    {
      architectureType?: string(name='ArchitectureType', description='The architecture of the instance. Default value: NULL. Valid values:

*   **cluster**: cluster architecture
*   **standard**: standard architecture
*   **rwsplit**: read/write splitting architecture
*   **NULL**: all of the preceding architectures', example='cluster'),
      bandwidth?: long(name='Bandwidth', description='The bandwidth of the instance. Unit: Mbit/s.', example='96'),
      capacity?: long(name='Capacity', description='The storage capacity of the instance. Unit: MB.', example='4096'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
      cloudType?: string(name='CloudType', description='This parameter is returned only when the instance is in a cloud box.', example='cloudbox'),
      computingType?: string(name='ComputingType', description='The type of the computing resource. Valid values:

*   **Ecs**: cloud-native computing service
*   **Machine**: physical machine', example='Ecs'),
      config?: string(name='Config', description='The parameter configurations of the instance. For more information, see [Modify parameters of an instance](https://help.aliyun.com/document_detail/43885.html).', example='{\\\\"maxmemory-policy\\\\":\\\\"volatile-lfu\\\\",\\\\"EvictionPolicy\\\\":\\\\"volatile-lru\\\\",\\\\"hash-max-ziplist-entries\\\\":512,\\\\"zset-max-ziplist-entries\\\\":128,\\\\"zset-max-ziplist-value\\\\":64,\\\\"set-max-intset-entries\\\\":512,\\\\"hash-max-ziplist-value\\\\":64,\\\\"#no_loose_disabled-commands\\\\":\\\\"flushall,flushdb\\\\",\\\\"lazyfree-lazy-eviction\\\\":\\\\"yes\\\\"}'),
      connectionDomain?: string(name='ConnectionDomain', description='The internal endpoint of the instance.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
      connectionMode?: string(name='ConnectionMode', description='The connection mode of the instance. Valid values:

*   **Standard**: standard mode
*   **Safe**: database proxy mode', example='Standard'),
      connections?: long(name='Connections', description='The maximum number of connections supported by the instance.', example='20000'),
      createTime?: string(name='CreateTime', description='The time when the instance was created.', example='2018-11-07T08:49:00Z'),
      destroyTime?: string(name='DestroyTime', description='The time when the instance was deleted.', example='2019-04-28T10:03:01Z'),
      editionType?: string(name='EditionType', description='The edition of the instance. Valid values:

*   **Community**: Redis Open-Source Edition
*   **Enterprise**: Tair (Enterprise Edition)', example='Enterprise'),
      endTime?: string(name='EndTime', description='The time when the subscription instance expires.', example='2019-06-13T16:00:00Z'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='4.0'),
      globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance.

>  This parameter is returned only if the instance is a child instance of a distributed instance.', example='gr-bp14rkqrhac****'),
      hasRenewChangeOrder?: boolean(name='HasRenewChangeOrder', description='Indicates whether your Alibaba Cloud account has pending orders for renewal and configuration change. Valid values:

*   **true**
*   **false**', example='false'),
      instanceClass?: string(name='InstanceClass', description='The instance class.', example='redis.logic.sharding.2g.2db.0rodb.4proxy.default'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='apitest'),
      instanceStatus?: string(name='InstanceStatus', description='The state of the instance. Valid values:

*   **Normal**: The instance is normal.
*   **Creating**: The instance is being created.
*   **Changing**: The configurations of the instance are being changed.
*   **Inactive**: The instance is disabled.
*   **Flushing**: The instance is being released.
*   **Released**: The instance is released.
*   **Transforming**: The billing method of the instance is being changed.
*   **Unavailable**: The instance is unavailable.
*   **Error**: The instance failed to be created.
*   **Migrating**: The instance is being migrated.
*   **BackupRecovering**: The instance is being restored from a backup.
*   **MinorVersionUpgrading**: The minor version of the instance is being updated.
*   **NetworkModifying**: The network type of the instance is being changed.
*   **SSLModifying**: The SSL configurations of the instance are being changed.
*   **MajorVersionUpgrading**: The major version of the instance is being upgraded. The instance remains accessible during the upgrade.', example='Normal'),
      instanceType?: string(name='InstanceType', description='The database engine of the instance. Valid values:

*   **Tair**
*   **Redis**
*   **Memcache**', example='Redis'),
      isRds?: boolean(name='IsRds', description='Indicates whether the instance is managed by ApsaraDB RDS. Valid values:

*   **true**
*   **false**', example='true'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **CLASSIC**
*   **VPC**', example='CLASSIC'),
      nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **double**: The instance contains a master node and a replica node.
*   **single**: The instance contains only a master node. This node type is phased out.', example='double'),
      packageType?: string(name='PackageType', description='The plan type. Valid values:

*   **standard**: standard plan
*   **customized**: custom plan', example='standard'),
      port?: long(name='Port', description='The service port of the instance.', example='6379'),
      privateIp?: string(name='PrivateIp', description='The private IP address.

>  This parameter is not returned when the instance is deployed in the classic network.', example='172.16.49.***'),
      QPS?: long(name='QPS', description='The number of queries per second (QPS).', example='100000'),
      readOnlyCount?: string(name='ReadOnlyCount', description='The number of read replicas in the primary zone.

>  The **ReadOnlyCount** and **SlaveReadOnlyCount** parameters are applicable only to cloud-native instances for which read/write splitting is enabled. If the instance is a cluster instance, the preceding parameters indicate the number of read replicas **per node** in the primary and secondary zones of the instance.', example='1'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      replacateId?: string(name='ReplacateId', description='The logical ID of the distributed instance.', example='grr-bp11381ebc16****'),
      replicaCount?: int32(name='ReplicaCount', description='The number of replica nodes in the primary zone.

>  The **ReplicaCount** and **SlaveReplicaCount** parameters are applicable only to cloud-native instances. If the instance is a cluster instance, the preceding parameters indicate the number of replica nodes **per node** in the primary and secondary zones of the instance.', example='1'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-acfmyiu4ekp****'),
      secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the secondary zone.

>  If multiple zones are returned for **ZoneId**, such as cn-hangzhou-MAZ10(h,i), this parameter is ignored.', example='cn-hangzhou-h'),
      shardClass?: string(name='ShardClass', description='The shard class. For more information about shard classes, see [Overview](https://help.aliyun.com/document_detail/26350.html).

>  The overall performance of a cluster instance is calculated by multiplying the class of a single shard (ShardClass) by the number of shards (ShardCount).', example='redis.shard.small.ce'),
      shardCount?: int32(name='ShardCount', description='The number of data shards in the cluster instance.

>  This parameter is returned only for cloud-native cluster instances or read/write splitting instances.', example='3'),
      slaveReadOnlyCount?: int32(name='SlaveReadOnlyCount', description='The number of read replicas in the secondary zone.', example='1'),
      slaveReplicaCount?: int32(name='SlaveReplicaCount', description='The number of replica nodes in the secondary zone.', example='1'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The key of the tag.', example='key1'),
          value?: string(name='Value', description='The value of the tag.', example='value1'),
        }
      ](name='Tag')
      }(name='Tags', description='Details about the tags.'),
      userName?: string(name='UserName', description='The username used to connect to the instance. By default, a username named after the instance ID is included.', example='r-bp1zxszhcgatnx****'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-bp1e7clcw529l773d****'),
      vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-bp1nme44gek34slfc****'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-b'),
    }
  ](name='KVStoreInstance')
  }(name='Instances', description='Details about the instances.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1E83311F-0EE4-4922-A3BF-730B312B****'),
  totalCount?: int32(name='TotalCount', description='The total number of instances.', example='1'),
}

model DescribeInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstancesResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more Tair (Redis OSS-compatible) instances.
 *
 * @param request DescribeInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstancesResponse
 */
async function describeInstancesWithOptions(request: DescribeInstancesRequest, runtime: $RuntimeOptions): DescribeInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.architectureType)) {
    query['ArchitectureType'] = request.architectureType;
  }
  if (!$isNull(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!$isNull(request.editionType)) {
    query['EditionType'] = request.editionType;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.expired)) {
    query['Expired'] = request.expired;
  }
  if (!$isNull(request.globalInstance)) {
    query['GlobalInstance'] = request.globalInstance;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!$isNull(request.instanceStatus)) {
    query['InstanceStatus'] = request.instanceStatus;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.privateIp)) {
    query['PrivateIp'] = request.privateIp;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.searchKey)) {
    query['SearchKey'] = request.searchKey;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstances',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about one or more Tair (Redis OSS-compatible) instances.
 *
 * @param request DescribeInstancesRequest
 * @return DescribeInstancesResponse
 */
async function describeInstances(request: DescribeInstancesRequest): DescribeInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstancesWithOptions(request, runtime);
}

model DescribeInstancesOverviewRequest {
  architectureType?: string(name='ArchitectureType', description='The architecture of the instance. Valid values:

*   **cluster**: cluster architecture
*   **standard**: standard architecture
*   **rwsplit**: read/write splitting architecture', example='standard'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
  editionType?: string(name='EditionType', description='The edition of the instance. Valid values:

*   **Community**: Redis Open-Source Edition
*   **Enterprise**: Tair (Enterprise Edition)', example='Enterprise'),
  engineVersion?: string(name='EngineVersion', description='The engine version of the instance. Valid values: **2.8**, **4.0**, **5.0**, **6.0**, and **7.0**.

Valid values:

*   1.0
*   2.8
*   4.0
*   5.0
*   6.0
*   7.0', example='4.0'),
  instanceClass?: string(name='InstanceClass', description='The instance type of the instance. For more information, see [Instance types](https://help.aliyun.com/document_detail/107984.html).', example='redis.master.small.default'),
  instanceIds?: string(name='InstanceIds', description='The IDs of instances.

> By default, all instances that belong to this account are queried. If you specify multiple instance IDs, separate the instance IDs with commas (,).', example='r-bp1zxszhcgatnx****'),
  instanceStatus?: string(name='InstanceStatus', description='The state of the instance. Valid values:

*   **Normal**: The instance is normal.
*   **Creating**: The instance is being created.
*   **Changing**: The configurations of the instance are being changed.
*   **Inactive**: The instance is disabled.
*   **Flushing**: The instance is being released.
*   **Released**: The instance is released.
*   **Transforming**: The billing method of the instance is being changed.
*   **Unavailable**: The instance is unavailable.
*   **Error**: The instance failed to be created.
*   **Migrating**: The instance is being migrated.
*   **BackupRecovering**: The instance is being restored from a backup.
*   **MinorVersionUpgrading**: The minor version of the instance is being updated.
*   **NetworkModifying**: The network type of the instance is being changed.
*   **SSLModifying**: The SSL certificate of the instance is being changed.
*   **MajorVersionUpgrading**: The major version of the instance is being upgraded. The instance remains accessible during the upgrade.

> For more information about instance states, see [Instance states and impacts](https://help.aliyun.com/document_detail/200740.html).', example='Normal'),
  instanceType?: string(name='InstanceType', description='The category of the instance. Valid values:

*   **Tair**
*   **Redis**
*   **Memcache**', example='Redis'),
  networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **CLASSIC**: classic network
*   **VPC**: Virtual Private Cloud (VPC)', example='CLASSIC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  privateIp?: string(name='PrivateIp', description='The private IP address of the instance.', example='172.16.49.***'),
  regionId?: string(name='RegionId', description='The ID of the region in which the instances you want to query reside. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instances you want to query belong.

> You can query resource group IDs by using the Tair (Redis OSS-compatible) console or by calling the [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html) operation. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  searchKey?: string(name='SearchKey', description='The keyword used for fuzzy search. The keyword can be based on an instance ID or an instance description.', example='apitest'),
  securityToken?: string(name='SecurityToken'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hangzhou-b'),
}

model DescribeInstancesOverviewResponseBody = {
  instances?: [ 
    {
      architectureType?: string(name='ArchitectureType', description='The architecture of the instance. Valid values:

*   **cluster**: cluster architecture
*   **standard**: standard architecture
*   **rwsplit**: read/write splitting architecture', example='cluster'),
      capacity?: long(name='Capacity', description='The storage capacity of the instance. Unit: MB.', example='4096'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
      connectionDomain?: string(name='ConnectionDomain', description='The internal endpoint of the instance.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
      createTime?: string(name='CreateTime', description='The time when the instance was created.', example='2018-11-07T08:49:00Z'),
      endTime?: string(name='EndTime', description='The time when the subscription instance expires.', example='2022-06-13T16:00:00Z'),
      engineVersion?: string(name='EngineVersion', description='The engine version of the instance. Valid values: **2.8**, **4.0**, **5.0**, **6.0**, and **7.0**.', example='4.0'),
      globalInstanceId?: string(name='GlobalInstanceId', description='The ID of the distributed instance.

> This parameter is returned only when the instance is a child instance of a distributed instance.', example='gr-bp14rkqrhac****'),
      instanceClass?: string(name='InstanceClass', description='The instance type of the instance.', example='redis.logic.sharding.2g.2db.0rodb.4proxy.default'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='apitest'),
      instanceStatus?: string(name='InstanceStatus', description='The state of the instance. Valid values:

*   **Normal**: The instance is normal.
*   **Creating**: The instance is being created.
*   **Changing**: The configurations of the instance are being changed.
*   **Inactive**: The instance is disabled.
*   **Flushing**: The instance is being released.
*   **Released**: The instance is released.
*   **Transforming**: The billing method of the instance is being changed.
*   **Unavailable**: The instance is unavailable.
*   **Error**: The instance failed to be created.
*   **Migrating**: The instance is being migrated.
*   **BackupRecovering**: The instance is being restored from a backup.
*   **MinorVersionUpgrading**: The minor version of the instance is being updated.
*   **NetworkModifying**: The network type of the instance is being changed.
*   **SSLModifying**: The SSL certificate of the instance is being changed.
*   **MajorVersionUpgrading**: The major version of the instance is being upgraded. The instance remains accessible during the upgrade.', example='Normal'),
      instanceType?: string(name='InstanceType', description='The edition of the instance. Valid values:

*   **Tair**: Tair (Enterprise Edition)
*   **Redis**: Redis Open-Source Edition
*   **Memcache**', example='Redis'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **CLASSIC**: classic network
*   **VPC**: VPC', example='CLASSIC'),
      privateIp?: string(name='PrivateIp', description='The private IP address of the instance.

> This parameter is not returned when the instance is deployed in the classic network.', example='172.16.49.***'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-acfmyiu4ekp****'),
      secondaryZoneId?: string(name='SecondaryZoneId', description='Instance\\\\"s secondary zone id.
> This parameter is only returned when the instance has a secondary zone ID.', example='cn-hangzhou-g'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch to which the instance is connected.', example='vsw-bp1e7clcw529l773d****'),
      vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp1nme44gek34slfc****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hangzhou-b'),
    }
  ](name='Instances', description='The queried instances.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1E83311F-0EE4-4922-A3BF-730B312B****'),
  totalCount?: int32(name='TotalCount', description='The total number of instances.', example='1'),
}

model DescribeInstancesOverviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstancesOverviewResponseBody(name='body'),
}

/**
 * @summary Queries the overview information of one or more Tair (Redis OSS-compatible) instances.
 *
 * @description If you do not specify the InstanceIds parameter when you call this operation, the overview information of all instances is returned.
 * > This operation returns non-paged results.
 *
 * @param request DescribeInstancesOverviewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstancesOverviewResponse
 */
async function describeInstancesOverviewWithOptions(request: DescribeInstancesOverviewRequest, runtime: $RuntimeOptions): DescribeInstancesOverviewResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.architectureType)) {
    query['ArchitectureType'] = request.architectureType;
  }
  if (!$isNull(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!$isNull(request.editionType)) {
    query['EditionType'] = request.editionType;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!$isNull(request.instanceStatus)) {
    query['InstanceStatus'] = request.instanceStatus;
  }
  if (!$isNull(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!$isNull(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.privateIp)) {
    query['PrivateIp'] = request.privateIp;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.searchKey)) {
    query['SearchKey'] = request.searchKey;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstancesOverview',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the overview information of one or more Tair (Redis OSS-compatible) instances.
 *
 * @description If you do not specify the InstanceIds parameter when you call this operation, the overview information of all instances is returned.
 * > This operation returns non-paged results.
 *
 * @param request DescribeInstancesOverviewRequest
 * @return DescribeInstancesOverviewResponse
 */
async function describeInstancesOverview(request: DescribeInstancesOverviewRequest): DescribeInstancesOverviewResponse {
  var runtime = new $RuntimeOptions{};
  return describeInstancesOverviewWithOptions(request, runtime);
}

model DescribeIntranetAttributeRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeIntranetAttributeResponseBody = {
  autoRenewal?: boolean(name='AutoRenewal', description='Indicates whether auto-renewal is enabled for the extra internal bandwidth that you purchased. Valid values:

*   **true**: Auto-renewal is enabled.
*   **false**: Auto-renewal is disabled.

> If no extra internal bandwidth is purchased, this parameter is not returned.', example='true'),
  bandwidthExpireTime?: string(name='BandwidthExpireTime', description='The expiration time of the purchased bandwidth. The time follows the ISO 8601 standard in the *yyyy-MM-dd* T *HH:mm:ss* Z format.

> If no extra internal bandwidth is purchased, this parameter is not returned.', example='2021-03-06T16:00:00Z'),
  bandwidthPrePaid?: string(name='BandwidthPrePaid', description='The billing method of the bandwidth plan. Valid values:

*   **0**: pay-as-you-go
*   **1**: subscription', example='0'),
  expireTime?: string(name='ExpireTime', description='The time when the extra internal bandwidth that you purchased for temporary use expires. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.

> If no extra internal bandwidth for temporary use is purchased or the extra internal bandwidth that you purchased for temporary use has expired, **0** is returned for this parameter.', example='0'),
  hasPrePaidBandWidthOrderRunning?: boolean(name='HasPrePaidBandWidthOrderRunning', description='Specifies whether the instance has unexpired bandwidth plans. Valid values:

*   **true**: The instance has unexpired bandwidth plans.
*   **false**: The instance does not have unexpired bandwidth plans.

> If no extra internal bandwidth is purchased, this parameter is not returned.', example='true'),
  intranetBandwidth?: int32(name='IntranetBandwidth', description='The internal bandwidth of the instance. This parameter indicates the combined bandwidth of all shards in the instance. Unit: Mbit/s.', example='102'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25D42CC3-FBA1-4AEC-BCE2-B8DD3137****'),
}

model DescribeIntranetAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIntranetAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the internal bandwidth of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can call the [EnableAdditionalBandwidth](https://help.aliyun.com/document_detail/473771.html) operation to increase the internal bandwidth of an instance.
 *
 * @param request DescribeIntranetAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeIntranetAttributeResponse
 */
async function describeIntranetAttributeWithOptions(request: DescribeIntranetAttributeRequest, runtime: $RuntimeOptions): DescribeIntranetAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeIntranetAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the internal bandwidth of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can call the [EnableAdditionalBandwidth](https://help.aliyun.com/document_detail/473771.html) operation to increase the internal bandwidth of an instance.
 *
 * @param request DescribeIntranetAttributeRequest
 * @return DescribeIntranetAttributeResponse
 */
async function describeIntranetAttribute(request: DescribeIntranetAttributeRequest): DescribeIntranetAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return describeIntranetAttributeWithOptions(request, runtime);
}

model DescribeLogicInstanceTopologyRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeLogicInstanceTopologyResponseBody = {
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
  redisProxyList?: {
    nodeInfo?: [ 
    {
      bandwidth?: string(name='Bandwidth', description='The bandwidth throttling of the node. Unit: MB/s.', example='96'),
      capacity?: string(name='Capacity', description='The storage capacity of the node. Unit: MB.', example='5120'),
      connection?: string(name='Connection', description='The maximum number of connections.', example='320000'),
      nodeId?: string(name='NodeId', description='The ID of the node.', example='r-bp10noxlhcoim2****-proxy-3#542****'),
      nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **proxy**: proxy node
*   **db**: data node', example='proxy'),
    }
  ](name='NodeInfo')
  }(name='RedisProxyList', description='The detailed proxy information, including information about proxy nodes.'),
  redisShardList?: {
    nodeInfo?: [ 
    {
      bandwidth?: string(name='Bandwidth', description='The bandwidth throttling of the node. Unit: MB/s.', example='96'),
      capacity?: string(name='Capacity', description='The storage capacity of the node. Unit: MB.', example='2048'),
      connection?: string(name='Connection', description='The maximum number of connections.', example='10000'),
      nodeId?: string(name='NodeId', description='The ID of the node.', example='r-bp10noxlhcoim2****-db-0#688****'),
      nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **proxy**: proxy node
*   **db**: data node', example='db'),
      subInstanceType?: string(name='SubInstanceType', description='子实例类型，返回值：
* **master**：主节点类型。
* **readonly**：只读实例类型。', example='master'),
    }
  ](name='NodeInfo')
  }(name='RedisShardList', description='Details of data shards, which includes node information such as NodeInfo.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='794120D1-E0CF-4713-BAE4-EBAEA04506AF'),
}

model DescribeLogicInstanceTopologyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLogicInstanceTopologyResponseBody(name='body'),
}

/**
 * @summary Queries the logical topology of a Tair (Redis OSS-compatible) instance.
 *
 * @description This parameter is supported only for cluster and read/write splitting instances.
 *
 * @param request DescribeLogicInstanceTopologyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLogicInstanceTopologyResponse
 */
async function describeLogicInstanceTopologyWithOptions(request: DescribeLogicInstanceTopologyRequest, runtime: $RuntimeOptions): DescribeLogicInstanceTopologyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeLogicInstanceTopology',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the logical topology of a Tair (Redis OSS-compatible) instance.
 *
 * @description This parameter is supported only for cluster and read/write splitting instances.
 *
 * @param request DescribeLogicInstanceTopologyRequest
 * @return DescribeLogicInstanceTopologyResponse
 */
async function describeLogicInstanceTopology(request: DescribeLogicInstanceTopologyRequest): DescribeLogicInstanceTopologyResponse {
  var runtime = new $RuntimeOptions{};
  return describeLogicInstanceTopologyWithOptions(request, runtime);
}

model DescribeMonitorItemsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeMonitorItemsResponseBody = {
  monitorItems?: {
    KVStoreMonitorItem?: [ 
    {
      monitorKey?: string(name='MonitorKey', description='The metric.', example='select'),
      unit?: string(name='Unit', description='The unit of the metric.', example='Counts/s'),
    }
  ](name='KVStoreMonitorItem')
  }(name='MonitorItems', description='The returned metrics.

> *   **memoryUsage**, **GetQps**, and **PutQps** are supported only by ApsaraDB for Redis instances that use Redis 4.0 or later. **GetQps** and **PutQps** require the latest minor version. You can upgrade the major version or minor version of the instance as needed. For more information, see [Upgrade the major version](https://help.aliyun.com/document_detail/101764.html) and [Upgrade the minor version](https://help.aliyun.com/document_detail/56450.html).
> *   When you use instances of Redis 2.8, if the **hit_rate** metric is not displayed, you must upgrade the minor version of the instance. For more information, see [Upgrade the minor version](https://help.aliyun.com/document_detail/56450.html).'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='8BEB2618-9517-43F3-A233-E0B34512****'),
}

model DescribeMonitorItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorItemsResponseBody(name='body'),
}

/**
 * @summary Queries the metrics of an ApsaraDB for Redis instance.
 *
 * @description >  ApsaraDB for Redis has upgraded the monitoring metrics. The DescribeMonitorItems operation is phased out. For more information, see [The DescribeMonitorItems operation supported by ApsaraDB for Redis is phased out](https://help.aliyun.com/document_detail/189893.html).
 * After you call this operation to retrieve a list of metrics for a specified ApsaraDB for Redis instance, you can call the [DescribeHistoryMonitorValues](~~DescribeHistoryMonitorValues~~) operation to query monitoring history of the instance.
 *
 * @param request DescribeMonitorItemsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorItemsResponse
 */
async function describeMonitorItemsWithOptions(request: DescribeMonitorItemsRequest, runtime: $RuntimeOptions): DescribeMonitorItemsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeMonitorItems',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the metrics of an ApsaraDB for Redis instance.
 *
 * @description >  ApsaraDB for Redis has upgraded the monitoring metrics. The DescribeMonitorItems operation is phased out. For more information, see [The DescribeMonitorItems operation supported by ApsaraDB for Redis is phased out](https://help.aliyun.com/document_detail/189893.html).
 * After you call this operation to retrieve a list of metrics for a specified ApsaraDB for Redis instance, you can call the [DescribeHistoryMonitorValues](~~DescribeHistoryMonitorValues~~) operation to query monitoring history of the instance.
 *
 * @param request DescribeMonitorItemsRequest
 * @return DescribeMonitorItemsResponse
 */
async function describeMonitorItems(request: DescribeMonitorItemsRequest): DescribeMonitorItemsResponse {
  var runtime = new $RuntimeOptions{};
  return describeMonitorItemsWithOptions(request, runtime);
}

model DescribeParameterGroupRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  parameterGroupId?: string(name='ParameterGroupId', description='The ID of the parameter template.

This parameter is required.', example='rpg-sys-00*****'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeParameterGroupResponseBody = {
  parameterGroup?: {
    category?: long(name='Category', description='The service category. Valid values:

*   **0**: Redis Open-Source Edition
*   **1**: Tair (Enterprise Edition)', example='1'),
    created?: string(name='Created', description='The time when the parameter template was created.', example='2023-04-18 16:32:45'),
    engine?: string(name='Engine', description='The engine type. Valid values:

* *redis*: Redis or Tair DRAM-based instance
* *tair_pena*: Tair persistent memory-optimized instance
* *tair_pdb*: Tair ESSD-based instance', example='redis'),
    engineVersion?: string(name='EngineVersion', description='The compatible engine version.', example='5.0'),
    modified?: string(name='Modified', description='The time when the parameter template was last modified.', example='2023-04-18 16:32:45'),
    paramGroupId?: string(name='ParamGroupId', description='The parameter template ID, which is globally unique.', example='sys-001*****'),
    paramGroupsDetails?: [ 
      {
        paramName?: string(name='ParamName', description='The name of the parameter.', example='timeout'),
        paramValue?: string(name='ParamValue', description='The value of the parameter.', example='1000'),
      }
    ](name='ParamGroupsDetails', description='The parameter details of the parameter template.'),
    parameterGroupDesc?: string(name='ParameterGroupDesc', description='The description of the parameter template.', example='test'),
    parameterGroupName?: string(name='ParameterGroupName', description='The name of the parameter template.', example='testGroupName'),
  }(name='ParameterGroup', description='The information about the parameter template.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A501A191-BD70-5E50-98A9-C2A486A82****'),
}

model DescribeParameterGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterGroupResponseBody(name='body'),
}

/**
 * @summary Queries the basic information about a parameter template.
 *
 * @param request DescribeParameterGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterGroupResponse
 */
async function describeParameterGroupWithOptions(request: DescribeParameterGroupRequest, runtime: $RuntimeOptions): DescribeParameterGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.parameterGroupId)) {
    query['ParameterGroupId'] = request.parameterGroupId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameterGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the basic information about a parameter template.
 *
 * @param request DescribeParameterGroupRequest
 * @return DescribeParameterGroupResponse
 */
async function describeParameterGroup(request: DescribeParameterGroupRequest): DescribeParameterGroupResponse {
  var runtime = new $RuntimeOptions{};
  return describeParameterGroupWithOptions(request, runtime);
}

model DescribeParameterGroupSupportParamRequest {
  category?: string(name='Category', description='The service category. Valid values:

*   **standard**: ApsaraDB for Redis Community Edition
*   **enterprise**: ApsaraDB for Redis Enhanced Edition (Tair)', example='standard'),
  engineType?: string(name='EngineType', description='The engine type. Valid values:

*   **redis**: ApsaraDB for Redis Community Edition instance or Tair DRAM-based instance
*   **tair_pena**: Tair persistent memory-optimized instance
*   **tair_pdb**: Tair ESSD/SSD-based instance', example='redis'),
  engineVersion?: string(name='EngineVersion', description='The compatible engine version. Valid values:

*   For ApsaraDB for Redis Community Edition instances, set the parameter to **5.0**, **6.0**, or **7.0**.
*   For Tair DRAM-based instances that are compatible with Redis 5.0 or Redis 6.0, set the parameter to **5.0** or **6.0**.
*   For Tair persistent memory-optimized instances that are compatible with Redis 6.0, set the parameter to **1.0**.
*   For Tair ESSD-based instances that are compatible with Redis 6.0, set the parameter to **1.0**. For Tair SSD-based instances that are compatible with Redis 6.0, set the parameter to **2.0**.

This parameter is required.', example='5'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeParameterGroupSupportParamResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='BB73740C-23E2-4392-9DA4-2660C74C****'),
  resourceList?: [ 
    {
      category?: string(name='Category', description='The service category.', example='standard'),
      dbType?: string(name='DbType', description='The engine type.', example='redis'),
      dbVersion?: string(name='DbVersion', description='The engine version.', example='5'),
      paramName?: string(name='ParamName', description='The name of the parameter.', example='rt_threshold_ms'),
    }
  ](name='ResourceList', description='The parameters.'),
}

model DescribeParameterGroupSupportParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterGroupSupportParamResponseBody(name='body'),
}

/**
 * @summary Queries the parameters that can be configured in parameter templates across different database versions.
 *
 * @param request DescribeParameterGroupSupportParamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterGroupSupportParamResponse
 */
async function describeParameterGroupSupportParamWithOptions(request: DescribeParameterGroupSupportParamRequest, runtime: $RuntimeOptions): DescribeParameterGroupSupportParamResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.engineType)) {
    query['EngineType'] = request.engineType;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameterGroupSupportParam',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the parameters that can be configured in parameter templates across different database versions.
 *
 * @param request DescribeParameterGroupSupportParamRequest
 * @return DescribeParameterGroupSupportParamResponse
 */
async function describeParameterGroupSupportParam(request: DescribeParameterGroupSupportParamRequest): DescribeParameterGroupSupportParamResponse {
  var runtime = new $RuntimeOptions{};
  return describeParameterGroupSupportParamWithOptions(request, runtime);
}

model DescribeParameterGroupTemplateListRequest {
  category?: string(name='Category', description='The service category. Valid values:

*   **standard**: Redis Open-Source Edition
*   **enterprise**: Tair (Enterprise Edition)

This parameter is required.', example='standard'),
  characterType?: string(name='CharacterType', description='The role of the instance. Valid values: logic: logical instance. db: database instance. proxy: proxy node. cs: ConfigServer node. normal: master-replica database instance.', example='db'),
  engineType?: string(name='EngineType', description='The engine type. Valid values:

*   **redis**: Redis Open-Source Edition or Tair (In-Memory)
*   **tair_pena**: Tair (On NVM)
*   **tair_pdb**: Tair (On Disk)

This parameter is required.', example='redis'),
  engineVersion?: string(name='EngineVersion', description='The compatible engine version. Valid values:

*   For Redis Open-Source Edition instances, set the parameter to **5.0**, **6.0**, or **7.0**.
*   For Tair DRAM-based instances that are compatible with Redis 5.0, 6.0, or 7.0, set the parameter to **5.0**, **6.0**, or **7.0**.
*   For Tair persistent memory-optimized instances that are compatible with Redis 6.0, set the parameter to **1.0**.
*   For Tair ESSD-based instances that are compatible with Redis 6.0, set the parameter to **1.0**. For Tair SSD-based instances that are compatible with Redis 6.0, set the parameter to **2.0**.

This parameter is required.', example='5.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeParameterGroupTemplateListResponseBody = {
  engineVersion?: string(name='EngineVersion', description='The compatible engine version. Valid values:

Redis Open Source Edition: 5.0, 6.0, and 7.0. Tair DRAM-based instances: 5.0 and 6.0. Tair persistent memory-optimized instances: 6.0. Tair ESSD-based instances: 4.0.', example='5'),
  parameters?: [ 
    {
      checkingCode?: string(name='CheckingCode', description='The regular expression used to validate input.', example='"\\\\\\\\d+\\\\\\\\s+\\\\\\\\d+\\\\\\\\s+\\\\\\\\d+"'),
      effective?: long(name='Effective', description='Indicates whether the modification takes effect. Valid values: 0 and 1. A value of 0 indicates that the modification does not take effect. A value of 1 indicates that the modification takes effect.', example='1'),
      factor?: long(name='Factor', description='A divisor of the parameter. For a parameter of the integer or byte type, the valid values must be a multiple of Factor unless you set Factor to 0.', example='1'),
      parameterDescription?: string(name='ParameterDescription', description='The description of the parameter.', example='Open AOF persistence mode'),
      parameterName?: string(name='ParameterName', description='The parameter name.', example='appendonly'),
      parameterValue?: string(name='ParameterValue', description='The default value of the parameter.', example='10'),
      revisable?: long(name='Revisable', description='Indicates whether the parameter can be modified. Valid values:

*   **0: The parameter cannot be modified.**
*   **1**: The parameter can be modified.', example='0'),
      supportModifyForMinorVersion?: boolean(name='SupportModifyForMinorVersion', description='Indicates whether the minor version can be changed. Valid values: true and false.', example='true'),
      unit?: string(name='Unit', description='The unit of the parameter value. Valid values: INT (ordinary integer), STRING (fixed string), and B (byte).', example='STRING'),
    }
  ](name='Parameters', description='The information about parameters.'),
  requestId?: string(name='RequestId', description='Id of the request', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model DescribeParameterGroupTemplateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterGroupTemplateListResponseBody(name='body'),
}

/**
 * @summary Queries the information about the parameters that can be configured in a parameter template, such as the default values, value ranges, and descriptions.
 *
 * @param request DescribeParameterGroupTemplateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterGroupTemplateListResponse
 */
async function describeParameterGroupTemplateListWithOptions(request: DescribeParameterGroupTemplateListRequest, runtime: $RuntimeOptions): DescribeParameterGroupTemplateListResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameterGroupTemplateList',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about the parameters that can be configured in a parameter template, such as the default values, value ranges, and descriptions.
 *
 * @param request DescribeParameterGroupTemplateListRequest
 * @return DescribeParameterGroupTemplateListResponse
 */
async function describeParameterGroupTemplateList(request: DescribeParameterGroupTemplateListRequest): DescribeParameterGroupTemplateListResponse {
  var runtime = new $RuntimeOptions{};
  return describeParameterGroupTemplateListWithOptions(request, runtime);
}

model DescribeParameterGroupsRequest {
  dbType?: string(name='DbType', description='The engine type. Valid values:

*   **redis**: Redis Open-Source Edition or Tair (In-Memory)
*   **tair_pena**: Tair (On NVM)
*   **tair_pdb**: Tair (On Disk)', example='redis'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeParameterGroupsResponseBody = {
  parameterGroups?: [ 
    {
      category?: long(name='Category', description='The service category. Valid values:

*   **0**: Redis Open-Source Edition
*   **1**: Tair (Enterprise Edition)', example='0'),
      created?: string(name='Created', description='The time when the parameter template was created.', example='2023-04-18 16:32:45'),
      engine?: string(name='Engine', description='The engine type. Valid values:

*   **redis**: Redis Open-Source Edition or Tair (In-Memory)
*   **tair_pena**: Tair (On NVM)
*   **tair_pdb**: Tair (On Disk)', example='redis'),
      engineVersion?: string(name='EngineVersion', description='The compatible engine version.', example='5'),
      modified?: string(name='Modified', description='The time when the parameter template was last modified.', example='2023-04-18 16:32:45'),
      paramGroupId?: string(name='ParamGroupId', description='The parameter template ID.', example='test01'),
      parameterGroupDesc?: string(name='ParameterGroupDesc', description='The description of the parameter template.', example='test'),
      parameterGroupName?: string(name='ParameterGroupName', description='The name of the parameter template.', example='testGroupName'),
    }
  ](name='ParameterGroups', description='The list of parameter templates.'),
  requestId?: string(name='RequestId', description='The request ID.', example='686BB8A6-BBA5-47E5-8A75-D2ADE433****'),
}

model DescribeParameterGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterGroupsResponseBody(name='body'),
}

/**
 * @summary Queries a list of available parameter templates.
 *
 * @param request DescribeParameterGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterGroupsResponse
 */
async function describeParameterGroupsWithOptions(request: DescribeParameterGroupsRequest, runtime: $RuntimeOptions): DescribeParameterGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbType)) {
    query['DbType'] = request.dbType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameterGroups',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of available parameter templates.
 *
 * @param request DescribeParameterGroupsRequest
 * @return DescribeParameterGroupsResponse
 */
async function describeParameterGroups(request: DescribeParameterGroupsRequest): DescribeParameterGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return describeParameterGroupsWithOptions(request, runtime);
}

model DescribeParameterModificationHistoryRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2022-09-05T09:49:27Z'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the node.

> You can set this parameter to query the parameter settings of the specified node in a cluster instance.', example='r-bp1xxxxxxxxxxxxx-db-0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  parameterName?: string(name='ParameterName', description='The name of the parameter.', example='script_check_enable'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2022-09-05T08:49:27Z'),
}

model DescribeParameterModificationHistoryResponseBody = {
  historicalParameters?: {
    historicalParameter?: [ 
    {
      modifyTime?: string(name='ModifyTime', description='The time when the parameter was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-09-05T09:56:10Z'),
      newParameterValue?: string(name='NewParameterValue', description='The parameter value after modification.', example='0'),
      oldParameterValue?: string(name='OldParameterValue', description='The parameter value before modification.', example='-2'),
      parameterName?: string(name='ParameterName', description='The name of the parameter.', example='script_check_enable'),
    }
  ](name='HistoricalParameter')
  }(name='HistoricalParameters', description='The modification records of the parameters.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='963C20F0-7CE1-4591-AAF3-6F3CD1CE****'),
}

model DescribeParameterModificationHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterModificationHistoryResponseBody(name='body'),
}

/**
 * @summary Queries the parameter modification history of a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeParameterModificationHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterModificationHistoryResponse
 */
async function describeParameterModificationHistoryWithOptions(request: DescribeParameterModificationHistoryRequest, runtime: $RuntimeOptions): DescribeParameterModificationHistoryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.parameterName)) {
    query['ParameterName'] = request.parameterName;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameterModificationHistory',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the parameter modification history of a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeParameterModificationHistoryRequest
 * @return DescribeParameterModificationHistoryResponse
 */
async function describeParameterModificationHistory(request: DescribeParameterModificationHistoryRequest): DescribeParameterModificationHistoryResponse {
  var runtime = new $RuntimeOptions{};
  return describeParameterModificationHistoryWithOptions(request, runtime);
}

model DescribeParameterTemplatesRequest {
  characterType?: string(name='CharacterType', description='The architecture of the instance. For more information, see [Overview](https://help.aliyun.com/document_detail/86132.html). Valid values:

*   **logic**: The instance is a cluster master-replica instance or a read/write splitting instance.
*   **normal**: The instance is a standard master-replica instance.

This parameter is required.', example='logic'),
  engine?: string(name='Engine', description='The database engine that is run on the instance. Set the value to **Redis**.

This parameter is required.', example='Redis'),
  engineVersion?: string(name='EngineVersion', description='The major version of the instance. Valid values: **4.0**, **5.0**, **6.0**, and **7.0**.

This parameter is required.', example='5.0'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the IDs of instances.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs. You can call the [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html) operation to query the IDs of resource groups.

>  You can also query the ID of a resource group in the Resource Management console. For more information, see [View the basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeParameterTemplatesResponseBody = {
  engine?: string(name='Engine', description='The database engine that is run on the instance. The value **Redis** is returned for this parameter.', example='redis'),
  engineVersion?: string(name='EngineVersion', description='The major version of the instance.', example='5.0'),
  parameterCount?: string(name='ParameterCount', description='The number of parameters that are supported by the instance.', example='24'),
  parameters?: {
    templateRecord?: [ 
    {
      checkingCode?: string(name='CheckingCode', description='The valid values of the parameter.', example='[yes|no]'),
      forceModify?: boolean(name='ForceModify', description='Indicates whether the parameter can be reconfigured. Valid values:

*   **true**: The parameter can be reconfigured.
*   **false**: The parameter cannot be reconfigured.', example='true'),
      forceRestart?: boolean(name='ForceRestart', description='Indicates whether a restart of the instance is required after the parameter is reconfigured. Valid values:

*   **true**: After the parameter is reconfigured, you must restart the instance to make the new value of the parameter take effect.
*   **false**: After the parameter is reconfigured, the new value of the parameter immediately takes effect. You do not need to restart the instance.', example='true'),
      parameterDescription?: string(name='ParameterDescription', description='The description of the parameter.', example='test description'),
      parameterName?: string(name='ParameterName', description='The name of the parameter. For more information about the parameters and the parameter settings, see [Parameters](https://help.aliyun.com/document_detail/259681.html).', example='appendonly'),
      parameterValue?: string(name='ParameterValue', description='The default value of the parameter.', example='yes'),
    }
  ](name='TemplateRecord')
  }(name='Parameters', description='An array that consists of the details about the parameters returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9DA28D8E-514D-4F12-ADED-70A9C818****'),
}

model DescribeParameterTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterTemplatesResponseBody(name='body'),
}

/**
 * @summary Queries the parameters and their default values that are supported by Tair (Redis OSS-compatible) instances of different architectures and major versions.
 *
 * @description After you call this operation to query the parameters and default values of an instance, you can call the [ModifyInstanceConfig](https://help.aliyun.com/document_detail/473844.html) operation to reconfigure the parameters of the instance.
 *
 * @param request DescribeParameterTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterTemplatesResponse
 */
async function describeParameterTemplatesWithOptions(request: DescribeParameterTemplatesRequest, runtime: $RuntimeOptions): DescribeParameterTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!$isNull(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameterTemplates',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the parameters and their default values that are supported by Tair (Redis OSS-compatible) instances of different architectures and major versions.
 *
 * @description After you call this operation to query the parameters and default values of an instance, you can call the [ModifyInstanceConfig](https://help.aliyun.com/document_detail/473844.html) operation to reconfigure the parameters of the instance.
 *
 * @param request DescribeParameterTemplatesRequest
 * @return DescribeParameterTemplatesResponse
 */
async function describeParameterTemplates(request: DescribeParameterTemplatesRequest): DescribeParameterTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return describeParameterTemplatesWithOptions(request, runtime);
}

model DescribeParametersRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the node.

> You can set this parameter to query the parameter settings of the specified node in a cluster instance.', example='r-bp1xxxxxxxxxxxxx-db-0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeParametersResponseBody = {
  configParameters?: {
    parameter?: [ 
    {
      checkingCode?: string(name='CheckingCode', description='The check code that indicates the valid values of the parameter.', example='[0|1]'),
      forceRestart?: boolean(name='ForceRestart', description='Indicates whether the instance must be restarted for the modifications to take effect. Valid values:

*   **True**: The instance must be restarted for the modifications to take effect.
*   **False**: The instance does not need to be restarted for the modifications to take effect. Modifications immediately take effect.', example='true'),
      modifiableStatus?: boolean(name='ModifiableStatus', description='Indicates whether the parameter can be reset. Valid values:

*   **False**: The parameter cannot be reset.
*   **True**: The parameter can be reset.', example='true'),
      parameterDescription?: string(name='ParameterDescription', description='The description of the parameter.', example='Check all keys passed in the KEYS array map to the same slot.'),
      parameterName?: string(name='ParameterName', description='The name of the parameter.', example='script_check_enable'),
      parameterValue?: string(name='ParameterValue', description='The value of the parameter.', example='1'),
    }
  ](name='Parameter')
  }(name='ConfigParameters', description='The configuration parameters that have not taken effect.'),
  engine?: string(name='Engine', description='The database engine that the instance runs.', example='redis'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='4.0'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9C1338BE-8DE8-4890-A900-E1BC06BF****'),
  runningParameters?: {
    parameter?: [ 
    {
      checkingCode?: string(name='CheckingCode', description='The check code that indicates the valid values of the parameter.', example='[0|1]'),
      forceRestart?: string(name='ForceRestart', description='Indicates whether the instance must be restarted for the modifications to take effect. Valid values:

*   **True**: The instance must be restarted for the modifications to take effect.
*   **False**: The instance does not need to be restarted for the modifications to take effect. Modifications immediately take effect.', example='true'),
      modifiableStatus?: string(name='ModifiableStatus', description='Indicates whether the parameter can be reset. Valid values:

*   **False**: The parameter cannot be reset.
*   **True**: The parameter can be reset.', example='true'),
      parameterDescription?: string(name='ParameterDescription', description='The description of the parameter.', example='You can disable some dangerous commands, for example \\\\"keys,flushdb,flushall\\\\", the commands must be in [flushall,flushdb,keys,hgetall,eval,evalsha,script].'),
      parameterName?: string(name='ParameterName', description='The name of the parameter.', example='#no_loose_disabled-commands'),
      parameterValue?: string(name='ParameterValue', description='The value of the parameter.', example='keys,flushall,flushdb'),
    }
  ](name='Parameter')
  }(name='RunningParameters', description='The running parameters.'),
}

model DescribeParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParametersResponseBody(name='body'),
}

/**
 * @summary Queries the configuration parameters and running parameters of a Tair (Redis OSS-compatible) instance.
 *
 * @description This operation is applicable only to classic instances.
 * >  If the instance is deployed in cloud-native mode, you can use the [DescribeInstanceConfig](https://help.aliyun.com/document_detail/473846.html) operation to query the configuration and operational parameters of the instance.
 *
 * @param request DescribeParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParametersResponse
 */
async function describeParametersWithOptions(request: DescribeParametersRequest, runtime: $RuntimeOptions): DescribeParametersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameters',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the configuration parameters and running parameters of a Tair (Redis OSS-compatible) instance.
 *
 * @description This operation is applicable only to classic instances.
 * >  If the instance is deployed in cloud-native mode, you can use the [DescribeInstanceConfig](https://help.aliyun.com/document_detail/473846.html) operation to query the configuration and operational parameters of the instance.
 *
 * @param request DescribeParametersRequest
 * @return DescribeParametersResponse
 */
async function describeParameters(request: DescribeParametersRequest): DescribeParametersResponse {
  var runtime = new $RuntimeOptions{};
  return describeParametersWithOptions(request, runtime);
}

model DescribePriceRequest {
  businessInfo?: string(name='BusinessInfo', description='The extended information such as the promotional event ID and business information.', example='000000000000'),
  capacity?: long(name='Capacity', description='The storage capacity of the instance. Unit: MB. This parameter is used only to query Redis Open-Source Edition instances that are deployed in classic mode. We recommend that you use the **InstanceClass** parameter to specify an exact instance type.

>  If you specify the **InstanceClass** parameter, you do not need to specify the Capacity parameter.', example='1024'),
  chargeType?: string(name='ChargeType', description='The billing method. Valid values:

*   **PostPaid** (default): pay-as-you-go
*   **PrePaid**: subscription', example='PostPaid'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: youhuiquan_promotion_option_id_for_blank. This value indicates that no coupon code is available.', example='youhuiquan_promotion_option_id_for_blank'),
  engineVersion?: string(name='EngineVersion', description='The engine version of the instance. Valid values: **2.8**, **4.0**, and **5.0**.', example='5.0'),
  forceUpgrade?: boolean(name='ForceUpgrade', description='Specifies whether to forcefully change the configurations of the instance. Valid values:

*   **false**: forcefully changes the configurations.
*   **true** (default): does not forcefully change the configurations.', example='true'),
  instanceClass?: string(name='InstanceClass', description='The instance type.

**To view the instance type, perform the following steps:**

1.  In the [Overview](https://help.aliyun.com/document_detail/26350.html) topic, click the link in the **Reference** column corresponding to the instance type that you want to view.
2.  In the instance type table of the page that appears, find the instance type in the **InstanceClass** column.

When you query cloud-native cluster instances, you must set this parameter to one of the following values and use the Instances parameter to specify the instance type that you want to query.

*   ApsaraDB for Redis cluster instances: redis.cluster.sharding.common.ce
*   Tair DRAM-based cluster instances: tair.rdb.cluster.sharding.common
*   Tair persistent memory-based cluster instances: tair.scm.cluster.sharding.common.ce', example='redis.master.small.default'),
  instanceId?: string(name='InstanceId', description='The instance ID.

>  This parameter is required when the **OrderType** parameter is set to **UPGRADE** or **RENEW**.', example='r-bp1zxszhcgatnx****'),
  instances?: string(name='Instances', description='A JSON string that contains information about one or more cloud-native cluster instances. For more information, see the "Additional description of the Instances parameter" section of this topic.', example='Instances=[{"RegionId": "cn-hangzhou","ZoneId": "cn-hangzhou-b","InstanceClass": "redis.master.small.default","Period": "1","Quantity": "1","Capacity": "4096"}]'),
  nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **STAND_ALONE**: standalone
*   **MASTER_SLAVE** (default): high availability (master-replica)', example='MASTER_SLAVE'),
  orderParamOut?: string(name='OrderParamOut', description='Specifies whether to return parameters related to the order. Valid values:

*   **false** (default)
*   **true**', example='true'),
  orderType?: string(name='OrderType', description='The order type. Valid values:

*   **BUY**: specifies the orders that are used to purchase instances.
*   **UPGRADE**: specifies the orders that are used to change the configurations of instances.
*   **RENEW**: specifies the orders that are used to renew instances.
*   **CONVERT**: specifies the orders that are used to change the billing methods of instances.

This parameter is required.', example='BUY'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: long(name='Period', description='The subscription duration. Unit: months. Valid values: **1**, 2, 3, 4, 5, 6, 7, 8, **9**, **12**, **24**, and **36**.', example='3'),
  quantity?: long(name='Quantity', description='The number of instances that you want to purchase. Valid values: **1** to **30**. Default value: **1**.', example='1'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  shardCount?: int32(name='ShardCount', description='The number of shards. This parameter is applicable only to cloud-native cluster instances. You can use this parameter to customize the number of shards.', example='2'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeZones](https://help.aliyun.com/document_detail/473764.html) operation to query the most recent zone list.', example='cn-hangzhou-e'),
}

model DescribePriceResponseBody = {
  order?: {
    code?: string(name='Code', description='The order code.', example='""'),
    coupons?: {
      coupon?: [ 
      {
        couponNo?: string(name='CouponNo', description='The coupon ID.', example='youhuiquan_promotion_option_id_for_blank'),
        description?: string(name='Description', description='The description of the coupon.', example='coupondemo'),
        isSelected?: string(name='IsSelected', description='Indicates whether the coupon was selected.', example='true'),
        name?: string(name='Name', description='The coupon name.', example='test'),
      }
    ](name='Coupon')
    }(name='Coupons', description='Details about coupons.'),
    currency?: string(name='Currency', description='The currency used for payment. A value of CNY is used when the order was generated on the China site (aliyun.com), and a value of USD is used when the order was generated on the international site (alibabacloud.com).', example='CNY'),
    depreciateInfo?: {
      cheapRate?: long(name='CheapRate', description='The price reduction rate.', example='30%'),
      cheapStandAmount?: long(name='CheapStandAmount', description='The new total price displayed on the official website.', example='9*'),
      contractActivity?: {
        activityId?: long(name='ActivityId', description='The activity ID.', example='****'),
        activityName?: string(name='ActivityName', description='The activity name.', example='合同优惠_整单_xxx折'),
        finalFee?: double(name='FinalFee', description='The price after the promotion.'),
        finalPromFee?: double(name='FinalPromFee', description='The total discount amount.'),
        optionCode?: string(name='OptionCode', description='The promotion ID.', example='****'),
        optionIds?: {
          optionId?: [ long ](name='OptionId')
        }(name='OptionIds', description='The promotion IDs.'),
        prodFee?: double(name='ProdFee', description='The original price.', example='****'),
      }(name='ContractActivity', description='The activity information.'),
      differential?: long(name='Differential', description='The price difference displayed in the total order amount.', example='**'),
      differentialName?: string(name='DifferentialName', description='The name of the price difference.', example='XXXXX'),
      isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
      isShow?: boolean(name='IsShow', description='Indicates whether the price reduction rate is displayed.', example='true'),
      listPrice?: long(name='ListPrice', description='The list price.', example='1*'),
      monthPrice?: long(name='MonthPrice', description='The monthly price.', example='**'),
      originalStandAmount?: long(name='OriginalStandAmount', description='The original total price displayed on the official website.', example='12*'),
    }(name='DepreciateInfo', description='The activity information.'),
    discountAmount?: string(name='DiscountAmount', description='The discount amount of the order.', example='0.21'),
    handlingFeeAmount?: string(name='HandlingFeeAmount', description='The service fees of the order.', example='0.1'),
    isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
    message?: string(name='Message', description='The order information.', example='""'),
    originalAmount?: string(name='OriginalAmount', description='The original price of the order.', example='0.21'),
    ruleIds?: {
      ruleId?: [ string ](name='RuleId')
    }(name='RuleIds', description='The rule IDs.'),
    showDiscountInfo?: boolean(name='ShowDiscountInfo', description='Indicates whether the discount information is displayed.'),
    standDiscountPrice?: long(name='StandDiscountPrice', description='The discount.', example='****'),
    standPrice?: long(name='StandPrice', description='The discount.', example='0'),
    tradeAmount?: string(name='TradeAmount', description='The transaction price of the order.', example='10'),
  }(name='Order', description='The information about the order.'),
  orderParams?: string(name='OrderParams', description='The parameters of the order. This parameter is returned when OrderParamOut is set to `true`.', example='String'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3A40BE4E-1890-4972-889C-FEFA37663635'),
  rules?: {
    rule?: [ 
    {
      name?: string(name='Name', description='The name of the promotion rule.', example='test'),
      ruleDescId?: long(name='RuleDescId', description='The ID of the rule.', example='1111111111'),
      title?: string(name='Title', description='The title of the rule.', example='test'),
    }
  ](name='Rule')
  }(name='Rules', description='Details about promotion rules.'),
  subOrders?: {
    subOrder?: [ 
    {
      contractActivity?: boolean(name='ContractActivity', description='Indicates whether eligibility for the contracted discount is met.', example='****'),
      depreciateInfo?: {
        cheapRate?: long(name='CheapRate', description='The price reduction rate.', example='****'),
        cheapStandAmount?: long(name='CheapStandAmount', description='The new total price displayed on the official website.', example='****'),
        contractActivity?: {
          activityId?: long(name='ActivityId', description='The activity ID.', example='1412025702634847'),
          activityName?: string(name='ActivityName', description='The activity name.', example='****'),
          finalFee?: double(name='FinalFee', description='The discounted price.', example='****'),
          finalPromFee?: double(name='FinalPromFee', description='The transaction price.', example='****'),
          optionCode?: string(name='OptionCode', description='The promotion ID.', example='****'),
          optionIds?: {
            optionId?: [ long ](name='OptionId')
          }(name='OptionIds', description='The promotion ID.'),
          prodFee?: double(name='ProdFee', description='The original price.', example='****'),
        }(name='ContractActivity', description='The contract promotion.'),
        differential?: long(name='Differential', description='The promotional offer (displayed in the total order amount).', example='****'),
        differentialName?: string(name='DifferentialName', description='The name of the promotional offer.', example='****'),
        isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether eligibility for the contracted discount is met.', example='false'),
        listPrice?: long(name='ListPrice', description='The list price.', example='****'),
        monthPrice?: long(name='MonthPrice', description='The monthly price.', example='****'),
        originalStandAmount?: long(name='OriginalStandAmount', description='The original total price displayed on the official website.', example='****'),
        startTime?: string(name='StartTime', description='The start time of the activity.', example='2024-11-18T00:00:00Z'),
      }(name='DepreciateInfo', description='The price reduction information.'),
      discountAmount?: string(name='DiscountAmount', description='The discount amount of the order.', example='0.21'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='r-bp1xxxxxxxxxxxxx'),
      isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether eligibility for the contracted discount is met.', example='****'),
      moduleInstance?: {
        moduleInstance?: [ 
        {
          contractActivity?: boolean(name='ContractActivity', description='Indicates whether eligibility for the contracted discount is met.', example='****'),
          depreciateInfo?: {
            cheapRate?: double(name='CheapRate', description='The price reduction rate.', example='******'),
            cheapStandAmount?: double(name='CheapStandAmount', description='The new total price displayed on the official website.', example='****'),
            differential?: double(name='Differential', description='The promotional offer (displayed in the total order amount).', example='****'),
            differentialName?: string(name='DifferentialName', description='The name of the promotional offer.', example='****'),
            isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether eligibility for the contracted discount is met.', example='****'),
            isShow?: boolean(name='IsShow', description='Indicates whether the price reduction rate is displayed.', example='true'),
            listPrice?: double(name='ListPrice', description='The list price.', example='****'),
            monthPrice?: double(name='MonthPrice', description='The monthly price.', example='****'),
            originalStandAmount?: double(name='OriginalStandAmount', description='The original total price displayed on the official website.', example='****'),
            startTime?: string(name='StartTime', description='The start time of the activity.', example='2024-09-23T14:00:01Z'),
          }(name='DepreciateInfo', description='The price reduction information.'),
          discountFee?: double(name='DiscountFee', description='The discount.', example='****'),
          moduleAttrs?: {
            moduleAttr?: [ 
            {
              code?: string(name='Code', description='The attribute code.', example='****'),
              name?: string(name='Name', description='The attribute name.', example='****'),
              type?: long(name='Type', description='The attribute type.', example='****'),
              value?: string(name='Value', description='The attribute value.', example='****'),
            }
          ](name='moduleAttr')
          }(name='ModuleAttrs', description='The module attributes.'),
          moduleCode?: string(name='ModuleCode', description='The module code.', example='****'),
          moduleId?: string(name='ModuleId', description='The module ID.', example='****'),
          moduleName?: string(name='ModuleName', description='The module name.', example='****'),
          needOrderPay?: boolean(name='NeedOrderPay', description='Indicates whether the order is paid.', example='true'),
          payFee?: double(name='PayFee', description='The actual amount paid.', example='0.0'),
          pricingModule?: boolean(name='PricingModule', description='Indicates whether the item is billed.', example='****'),
          standPrice?: double(name='StandPrice', description='The discount.', example='****'),
          totalProductFee?: double(name='TotalProductFee', description='The original price of the product.', example='0.0'),
        }
      ](name='ModuleInstance')
      }(name='ModuleInstance', description='The configuration details for each instance of an order line item.'),
      optionalPromotions?: {
        optionalPromotion?: [ 
        {
          activityExtInfo?: map[string]any(name='ActivityExtInfo', description='The additional activity information.', example='****'),
          canPromFee?: string(name='CanPromFee', description='The amount that can be deducted by using the coupon.', example='****'),
          couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='default'),
          description?: string(name='Description', description='The description of the coupon.', example='****'),
          name?: string(name='Name', description='The coupon name.', example='****'),
          optionCode?: string(name='OptionCode', description='The promotion code.', example='****'),
          promotionName?: string(name='PromotionName', description='The promotion name.', example='****'),
          promotionOptionNo?: string(name='PromotionOptionNo', description='The promotion ID.', example='youhuiquan_promotion_option_id_for_blank'),
          selected?: boolean(name='Selected', description='Indicates whether', example='false'),
          show?: boolean(name='Show', description='Indicates whether the discount is displayed.', example='False'),
        }
      ](name='OptionalPromotion')
      }(name='OptionalPromotions', description='The optional promotions.'),
      originalAmount?: string(name='OriginalAmount', description='The original price of the order.', example='0.21'),
      promDetailList?: {
        promDetail?: [ 
        {
          activityExtInfo?: map[string]any(name='ActivityExtInfo', description='The additional activity information.', example='****'),
          derivedPromType?: string(name='DerivedPromType', description='The derived promotion type.', example='****'),
          finalPromFee?: double(name='FinalPromFee', description='The transaction price.', example='****'),
          optionCode?: string(name='OptionCode', description='The code of the coupon.', example='****'),
          promType?: string(name='PromType', description='The promotion type.', example='****'),
          promotionCode?: string(name='PromotionCode', description='The coupon code.', example='****'),
          promotionId?: long(name='PromotionId', description='The promotion ID.', example='****'),
          promotionName?: string(name='PromotionName', description='The name of the promotional activity.', example='****'),
        }
      ](name='PromDetail')
      }(name='PromDetailList', description='The promotion details.'),
      ruleIds?: {
        ruleId?: [ string ](name='RuleId')
      }(name='RuleIds', description='The rule IDs.'),
      standDiscountPrice?: long(name='StandDiscountPrice', description='The discount.', example='****'),
      standPrice?: long(name='StandPrice', description='The discount.', example='****'),
      tradeAmount?: string(name='TradeAmount', description='The final price of the order.', example='10'),
    }
  ](name='SubOrder')
  }(name='SubOrders', description='The rules that match the coupon.'),
}

model DescribePriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePriceResponseBody(name='body'),
}

/**
 * @summary Queries the fees that you must pay when you create, upgrade, or renew an ApsaraDB for Redis instance.
 *
 * @param request DescribePriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePriceResponse
 */
async function describePriceWithOptions(request: DescribePriceRequest, runtime: $RuntimeOptions): DescribePriceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.capacity)) {
    query['Capacity'] = request.capacity;
  }
  if (!$isNull(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.forceUpgrade)) {
    query['ForceUpgrade'] = request.forceUpgrade;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.instances)) {
    query['Instances'] = request.instances;
  }
  if (!$isNull(request.nodeType)) {
    query['NodeType'] = request.nodeType;
  }
  if (!$isNull(request.orderParamOut)) {
    query['OrderParamOut'] = request.orderParamOut;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.quantity)) {
    query['Quantity'] = request.quantity;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.shardCount)) {
    query['ShardCount'] = request.shardCount;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePrice',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the fees that you must pay when you create, upgrade, or renew an ApsaraDB for Redis instance.
 *
 * @param request DescribePriceRequest
 * @return DescribePriceResponse
 */
async function describePrice(request: DescribePriceRequest): DescribePriceResponse {
  var runtime = new $RuntimeOptions{};
  return describePriceWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The display language of the **LocalName** parameter value. Valid values:

*   **zh-CN**: Chinese
*   **en-US**: English

> The default value is **zh-CN**.', example='zh-CN'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeRegionsResponseBody = {
  regionIds?: {
    KVStoreRegion?: [ 
    {
      localName?: string(name='LocalName', description='The name of the region.', example='China (Hangzhou)'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of the region.', example='r-kvstore.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
      zoneIdList?: {
        zoneId?: [ string ](name='ZoneId')
      }(name='ZoneIdList', description='The zone IDs.'),
      zoneIds?: string(name='ZoneIds', description='The IDs of the zones in the region.', example='cn-hangzhou-h'),
    }
  ](name='KVStoreRegion')
  }(name='RegionIds', description='The **region IDs**.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='AD425AD3-CC7B-4EE2-A5CB-2F61BA73****'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries the regions in which ApsaraDB for Redis instances can be created.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: $RuntimeOptions): DescribeRegionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRegions',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the regions in which ApsaraDB for Redis instances can be created.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeRoleZoneInfoRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query instance IDs.

This parameter is required.', example='r-t4nlenc2p04uvb****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. The value must be an integer that is greater than **0** and less than or equal to the maximum value supported by the integer data type. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **10**, **20**, and **50**. Default value: **10**.', example='10'),
  queryType?: int32(name='QueryType', description='The type of the node to query. Default value: 1. Valid values:

*   **0**: proxy node

    **

    **Note** This parameter is supported only for cluster instances and read/write splitting instances.

*   **1**: data node', example='0'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeRoleZoneInfoResponseBody = {
  node?: {
    nodeInfo?: [ 
    {
      currentBandWidth?: long(name='CurrentBandWidth', description='The current bandwidth of the node, which consists of the default bandwidth and the increased bandwidth. Unit: MB/s.

> *   You can call the [EnableAdditionalBandwidth](https://help.aliyun.com/document_detail/473771.html) operation to specify the increased bandwidth.
> *   You can also use this parameter to calculate the increased bandwidth. For example, if the default bandwidth of the node is 96 MB/s and the returned value of this parameter is 100, the increased bandwidth is 4 MB/s.', example='100'),
      currentMinorVersion?: string(name='CurrentMinorVersion', description='The minor version of the node.', example='redis-5.0_0.3.10'),
      custinsId?: string(name='CustinsId', description='The ID of the data shard.', example='30381****'),
      defaultBandWidth?: long(name='DefaultBandWidth', description='The default bandwidth of the node. Unit: MB/s.', example='96'),
      insName?: string(name='InsName', description='The ID of the node.', example='r-t4nlenc2p04uvb****'),
      insType?: int32(name='InsType', description='Indicates whether the node is a read replica. If the node is a read replica, **3** is returned.

>  If the node is not a read replica, no value is returned.', example='3'),
      isLatestVersion?: int32(name='IsLatestVersion', description='Indicates whether the minor version is the latest version. Valid values:

*   **0**: The minor version is not the latest version.
*   **1**: The minor version is the latest version.

>  To update the minor version, call the [ModifyInstanceMinorVersion](https://help.aliyun.com/document_detail/473777.html) operation.', example='1'),
      isOpenBandWidthService?: boolean(name='IsOpenBandWidthService', description='Indicates whether the bandwidth of the node is increased. Valid values:

*   **true**: The bandwidth of the node is not increased.
*   **false**: The bandwidth of the node is increased.', example='true'),
      nodeId?: string(name='NodeId', description='This parameter is used only for internal maintenance of instances.', example='10065****'),
      nodeType?: string(name='NodeType', description='The node type. Valid values:

*   **db**: data node.
*   **proxy**: proxy node.
*   **normal**: regular node. This value is returned when the instance runs in the standard architecture.', example='normal'),
      role?: string(name='Role', description='The role of the node. Valid values:

*   **master**: master node
*   **slave**: replica node', example='master'),
      zoneId?: string(name='ZoneId', description='The ID of the zone.', example='cn-hangzhou-b'),
    }
  ](name='NodeInfo')
  }(name='Node', description='Details about each node in the instance.'),
  pageNumber?: int32(name='PageNumber', description='The number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='224B97FB-A275-4EAC-86E9-8922FEA2****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model DescribeRoleZoneInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRoleZoneInfoResponseBody(name='body'),
}

/**
 * @summary Queries the role, type, minor version, and zone of each node in a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeRoleZoneInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRoleZoneInfoResponse
 */
async function describeRoleZoneInfoWithOptions(request: DescribeRoleZoneInfoRequest, runtime: $RuntimeOptions): DescribeRoleZoneInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRoleZoneInfo',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the role, type, minor version, and zone of each node in a Tair (Redis OSS-compatible) instance.
 *
 * @param request DescribeRoleZoneInfoRequest
 * @return DescribeRoleZoneInfoResponse
 */
async function describeRoleZoneInfo(request: DescribeRoleZoneInfoRequest): DescribeRoleZoneInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeRoleZoneInfoWithOptions(request, runtime);
}

model DescribeRunningLogRecordsRequest {
  characterType?: string(name='CharacterType', description='The shard type of the cluster instance. Valid values:

*   **proxy**: proxy node
*   **db**: data node
*   **cs**: config server node

>  If you set this parameter, you must also set the **NodeId** parameter.', example='proxy'),
  DBName?: string(name='DBName', description='The name of the database.', example='0'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. The time range cannot exceed one day. We recommend that you specify 1 hour. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2018-12-03T08:01Z'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the node in the instance. You can set this parameter to query the operational logs of a specified node.

> 

*   This parameter is available only for read/write splitting and cluster instances.

*   If you set this parameter, you must also set the **CharacterType** parameter.', example='r-bp1zxszhcgatnx****-db-0'),
  orderType?: string(name='OrderType', description='The method that is used to sort the returned log entries. Valid values:

*   **asc**: ascending order
*   **desc**: descending order', example='asc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than **0** and less than or equal to the maximum value supported by the integer data type. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**. Default value: **30**.', example='30'),
  queryKeyword?: string(name='QueryKeyword', description='The keyword that is used to query operational logs.', example='aof'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleType?: string(name='RoleType', description='The role of the data shard. Default value: master. Valid values:

*   **master**: master node
*   **slave**: replica node', example='master'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2018-12-03T07:01Z'),
}

model DescribeRunningLogRecordsResponseBody = {
  engine?: string(name='Engine', description='The type of the database engine.', example='Redis'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
  items?: {
    logRecords?: [ 
    {
      content?: string(name='Content', description='The content of the log.', example='CONFIG REWRITE executed with success.'),
      createTime?: string(name='CreateTime', description='The time when the log was generated. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-12-03T07:07:30Z'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
      nodeId?: string(name='NodeId', description='The ID of the node.

>  If a standard instance is queried, `(null)` is returned.', example='r-bp1zxszhcgatnx****-db-0'),
    }
  ](name='LogRecords')
  }(name='Items', description='Details about the log entries.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of log entries returned on the current page.', example='5'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries returned on each page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='093B8579-9264-43A0-ABA9-AA86****'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.', example='2018-12-03T07:01Z'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries returned.', example='5'),
}

model DescribeRunningLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRunningLogRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the operational logs of a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about how to view the operational logs of an instance in the Tair (Redis OSS-compatible) console, see [View active logs](https://help.aliyun.com/document_detail/101713.html).
 * This operation can be called up to 100 times per minute.
 *
 * @param request DescribeRunningLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRunningLogRecordsResponse
 */
async function describeRunningLogRecordsWithOptions(request: DescribeRunningLogRecordsRequest, runtime: $RuntimeOptions): DescribeRunningLogRecordsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!$isNull(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.queryKeyword)) {
    query['QueryKeyword'] = request.queryKeyword;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.roleType)) {
    query['RoleType'] = request.roleType;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRunningLogRecords',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the operational logs of a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about how to view the operational logs of an instance in the Tair (Redis OSS-compatible) console, see [View active logs](https://help.aliyun.com/document_detail/101713.html).
 * This operation can be called up to 100 times per minute.
 *
 * @param request DescribeRunningLogRecordsRequest
 * @return DescribeRunningLogRecordsResponse
 */
async function describeRunningLogRecords(request: DescribeRunningLogRecordsRequest): DescribeRunningLogRecordsResponse {
  var runtime = new $RuntimeOptions{};
  return describeRunningLogRecordsWithOptions(request, runtime);
}

model DescribeSecurityGroupConfigurationRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeSecurityGroupConfigurationResponseBody = {
  items?: {
    ecsSecurityGroupRelation?: [ 
    {
      netType?: string(name='NetType', description='The network type of the security group. Valid values:

*   **classic**: the classic network.
*   **vpc**: the virtual private cloud (VPC).', example='vpc'),
      regionId?: string(name='RegionId', description='The ID of the region where the instance is deployed.', example='cn-hangzhou'),
      securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.', example='sg-bp14p9y07ns3gwq****'),
    }
  ](name='EcsSecurityGroupRelation')
  }(name='Items', description='The list of security groups.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='981C0D6A-D9DD-466C-92DA-F29DF755****'),
}

model DescribeSecurityGroupConfigurationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecurityGroupConfigurationResponseBody(name='body'),
}

/**
 * @summary Queries the security groups that are added to the whitelists of an ApsaraDB for Redis instance.
 *
 * @param request DescribeSecurityGroupConfigurationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecurityGroupConfigurationResponse
 */
async function describeSecurityGroupConfigurationWithOptions(request: DescribeSecurityGroupConfigurationRequest, runtime: $RuntimeOptions): DescribeSecurityGroupConfigurationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSecurityGroupConfiguration',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the security groups that are added to the whitelists of an ApsaraDB for Redis instance.
 *
 * @param request DescribeSecurityGroupConfigurationRequest
 * @return DescribeSecurityGroupConfigurationResponse
 */
async function describeSecurityGroupConfiguration(request: DescribeSecurityGroupConfigurationRequest): DescribeSecurityGroupConfigurationResponse {
  var runtime = new $RuntimeOptions{};
  return describeSecurityGroupConfigurationWithOptions(request, runtime);
}

model DescribeSecurityIpsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeSecurityIpsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EFC9161F-15E3-4A6E-8A99-C09916D1****'),
  securityIpGroups?: {
    securityIpGroup?: [ 
    {
      securityIpGroupAttribute?: string(name='SecurityIpGroupAttribute', description='The attribute of the whitelist. This parameter is empty by default.

>  If the instance is authorized to use a service such as Database Autonomy Service (DAS), Data Management (DMS), or Data Transmission Service (DTS), this service automatically generates a **hidden** whitelist for the instance. This type of whitelists cannot be modified or deleted.', example='hidden'),
      securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the whitelist.', example='default'),
      securityIpList?: string(name='SecurityIpList', description='The IP addresses in the whitelist. A maximum of 1,000 IP addresses can be specified in a whitelist.'),
    }
  ](name='SecurityIpGroup')
  }(name='SecurityIpGroups', description='The whitelists of the instance.'),
}

model DescribeSecurityIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecurityIpsResponseBody(name='body'),
}

/**
 * @summary Queries the IP address whitelists of an ApsaraDB for Redis instance.
 *
 * @param request DescribeSecurityIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecurityIpsResponse
 */
async function describeSecurityIpsWithOptions(request: DescribeSecurityIpsRequest, runtime: $RuntimeOptions): DescribeSecurityIpsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSecurityIps',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the IP address whitelists of an ApsaraDB for Redis instance.
 *
 * @param request DescribeSecurityIpsRequest
 * @return DescribeSecurityIpsResponse
 */
async function describeSecurityIps(request: DescribeSecurityIpsRequest): DescribeSecurityIpsResponse {
  var runtime = new $RuntimeOptions{};
  return describeSecurityIpsWithOptions(request, runtime);
}

model DescribeSlowLogRecordsRequest {
  DBName?: string(name='DBName', description='The name of the database.', example='0'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. The time range cannot exceed one day. We recommend that you specify 1 hour. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2019-03-22T14:11Z'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the node in the instance. You can set this parameter to query the slow query logs of a specified node.

>  This parameter is available only for read/write splitting and cluster instances.', example='r-bp1zxszhcgatnx****-db-0'),
  orderBy?: string(name='OrderBy', description='The dimension by which to sort the results. Default value: execution_time. Valid values:

*   **execution_time**: sorts the results by query start time.
*   **latency**: sorts the results by query latency.', example='execution_time'),
  orderType?: string(name='OrderType', description='The sorting order of the results to return. Default value: DESC. Valid values:

*   **ASC**: ascending order
*   **DESC**: descending order', example='ASC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than **0**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**. Default value: **30**.', example='30'),
  queryKeyword?: string(name='QueryKeyword', description='The keyword based on which slow logs are queried. You can set this parameter to a value of the string type.', example='keyword1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  slowLogRecordType?: string(name='SlowLogRecordType', description='The type of the slow logs. Default value: db. Valid values:

*   **proxy**: slow logs of proxy nodes
*   **db**: slow logs of data nodes', example='proxy'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2019-03-10T14:11Z'),
}

model DescribeSlowLogRecordsResponseBody = {
  engine?: string(name='Engine', description='The database engine that the instance runs.', example='Redis'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp10n********'),
  items?: {
    logRecords?: [ 
    {
      account?: string(name='Account', description='The ID of the account.', example='0'),
      accountName?: string(name='AccountName', description='The username of the account.', example='demo'),
      command?: string(name='Command', description='The slow query statement.', example='KEYS *'),
      DBName?: string(name='DBName', description='The database name.', example='-1'),
      dataBaseName?: string(name='DataBaseName', description='The database name. This parameter serves the same purpose as the **DBName** parameter. We recommend that you use the **DBName** parameter.', example='-1'),
      elapsedTime?: long(name='ElapsedTime', description='The amount of time consumed to execute the slow query statement. Unit: microseconds.', example='248'),
      executeTime?: string(name='ExecuteTime', description='The start time when the slow query statement was executed. The time is displayed in the YYYY-MM-DDTHH:mm:ssZ format.', example='2019-03-20T09:18:41Z'),
      IPAddress?: string(name='IPAddress', description='The IP address of the client.', example='172.16.88.***'),
      nodeId?: string(name='NodeId', description='The node ID.', example='r-bp1zxszhcgatnx****-db-0'),
    }
  ](name='LogRecords')
  }(name='Items', description='The slow query log entries.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of log entries returned on the current page.', example='1'),
  pageSize?: int32(name='PageSize', description='The maximum number of log entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='686BB8A6-BBA5-47E5-8A75-D2ADE433****'),
  startTime?: string(name='StartTime', description='The start time of the query.', example='2019-03-10T13:11Z'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned log entries.', example='1'),
}

model DescribeSlowLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlowLogRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the slow query logs of a Tair (Redis OSS-compatible) instance that are generated within a specified period of time.
 *
 * @description You can also query slow logs in the Tair (Redis OSS-compatible) console. For more information, see [Query slow logs of an instance](https://help.aliyun.com/document_detail/95874.html). This operation can be called up to 100 times per minute.
 *
 * @param request DescribeSlowLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecordsWithOptions(request: DescribeSlowLogRecordsRequest, runtime: $RuntimeOptions): DescribeSlowLogRecordsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.queryKeyword)) {
    query['QueryKeyword'] = request.queryKeyword;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.slowLogRecordType)) {
    query['SlowLogRecordType'] = request.slowLogRecordType;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSlowLogRecords',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the slow query logs of a Tair (Redis OSS-compatible) instance that are generated within a specified period of time.
 *
 * @description You can also query slow logs in the Tair (Redis OSS-compatible) console. For more information, see [Query slow logs of an instance](https://help.aliyun.com/document_detail/95874.html). This operation can be called up to 100 times per minute.
 *
 * @param request DescribeSlowLogRecordsRequest
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecords(request: DescribeSlowLogRecordsRequest): DescribeSlowLogRecordsResponse {
  var runtime = new $RuntimeOptions{};
  return describeSlowLogRecordsWithOptions(request, runtime);
}

model DescribeTairKVCacheCustomInstanceAttributeRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='tc-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeTairKVCacheCustomInstanceAttributeResponseBody = {
  architectureType?: string(name='ArchitectureType', example='tair_custom'),
  chargeType?: string(name='ChargeType', example='PrePaid'),
  cpu?: long(name='Cpu', example='2'),
  createTime?: string(name='CreateTime', example='2024-02-21T08:23Z'),
  disks?: {
    disk?: [ 
    {
      diskId?: string(name='DiskId', example='d-5v1aggi3ffoxufb57**'),
      size?: string(name='Size', example='100'),
      type?: string(name='Type', example='data'),
    }
  ](name='Disk')
  }(name='Disks'),
  endTime?: string(name='EndTime', example='2024-05-28T00:00:00Z'),
  imageId?: string(name='ImageId', example='m-bp10k5694v6yfevajw**'),
  instanceClass?: string(name='InstanceClass', example='tair.gpu.test.16g'),
  instanceId?: string(name='InstanceId', example='tc-bp1zxszhcgatnx****'),
  instanceName?: string(name='InstanceName', example='newinstancename'),
  instanceStatus?: string(name='InstanceStatus', example='Normal'),
  instanceType?: string(name='InstanceType', example='TairCustom'),
  isOrderCompleted?: boolean(name='IsOrderCompleted', example='true'),
  memory?: long(name='Memory', example='262144'),
  networkType?: string(name='NetworkType', example='VPC'),
  privateIp?: string(name='PrivateIp', example='172.16.49.***'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  requestId?: string(name='RequestId', example='2BE6E619-A657-42E3-AD2D-18F8428A****'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyiu4ekp****'),
  securityGroupId?: string(name='SecurityGroupId', example='sg-bpcfmyiu4ekp****'),
  storage?: long(name='Storage', example='60'),
  storageType?: string(name='StorageType', example='essd_pl1'),
  tags?: {
    tag?: [ 
    {
      key?: string(name='Key', example='tag1'),
      value?: string(name='Value', example='value1'),
    }
  ](name='Tag')
  }(name='Tags'),
  useEni?: boolean(name='UseEni'),
  vSwitchId?: string(name='VSwitchId', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', example='cn-hangzhou-b'),
  zoneType?: string(name='ZoneType', example='singlezone'),
}

model DescribeTairKVCacheCustomInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTairKVCacheCustomInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary 查看TairCustom实例
 *
 * @param request DescribeTairKVCacheCustomInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTairKVCacheCustomInstanceAttributeResponse
 */
async function describeTairKVCacheCustomInstanceAttributeWithOptions(request: DescribeTairKVCacheCustomInstanceAttributeRequest, runtime: $RuntimeOptions): DescribeTairKVCacheCustomInstanceAttributeResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTairKVCacheCustomInstanceAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查看TairCustom实例
 *
 * @param request DescribeTairKVCacheCustomInstanceAttributeRequest
 * @return DescribeTairKVCacheCustomInstanceAttributeResponse
 */
async function describeTairKVCacheCustomInstanceAttribute(request: DescribeTairKVCacheCustomInstanceAttributeRequest): DescribeTairKVCacheCustomInstanceAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return describeTairKVCacheCustomInstanceAttributeWithOptions(request, runtime);
}

model DescribeTairKVCacheCustomInstanceHistoryMonitorValuesRequest {
  endTime?: string(name='EndTime', description='This parameter is required.', example='2024-09-20T00:00:00Z'),
  express?: string(name='Express', example='{\\\\"extend\\\\":{\\\\"workers\\\\":\\\\"avg_dispatchers\\\\"}}'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='tc-bp1zxszhcgatnx****'),
  length?: string(name='Length', example='1000'),
  metricName?: string(name='MetricName', example='CPUUtilization'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: string(name='Period', example='60'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2024-09-05T08:49:27Z'),
}

model DescribeTairKVCacheCustomInstanceHistoryMonitorValuesResponseBody = {
  datapoints?: string(name='Datapoints', example='{ “timestamp”: 1490164200000, “Maximum”: 100, “userId”: “1234567898765432”, “Minimum”: 4.55, “instanceId”: “i-bp18abl200xk9599ck7c”, “Average”: 93.84 }'),
  nextToken?: string(name='NextToken', example='212db86sca4384811e0b5e8707ec2****'),
  period?: string(name='Period', example='60'),
  requestId?: string(name='RequestId', example='F3F44BE3-5419-4B61-9BAC-E66E295A****'),
}

model DescribeTairKVCacheCustomInstanceHistoryMonitorValuesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTairKVCacheCustomInstanceHistoryMonitorValuesResponseBody(name='body'),
}

/**
 * @summary 查询TairCustom主机监控
 *
 * @param request DescribeTairKVCacheCustomInstanceHistoryMonitorValuesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTairKVCacheCustomInstanceHistoryMonitorValuesResponse
 */
async function describeTairKVCacheCustomInstanceHistoryMonitorValuesWithOptions(request: DescribeTairKVCacheCustomInstanceHistoryMonitorValuesRequest, runtime: $RuntimeOptions): DescribeTairKVCacheCustomInstanceHistoryMonitorValuesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTairKVCacheCustomInstanceHistoryMonitorValues',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询TairCustom主机监控
 *
 * @param request DescribeTairKVCacheCustomInstanceHistoryMonitorValuesRequest
 * @return DescribeTairKVCacheCustomInstanceHistoryMonitorValuesResponse
 */
async function describeTairKVCacheCustomInstanceHistoryMonitorValues(request: DescribeTairKVCacheCustomInstanceHistoryMonitorValuesRequest): DescribeTairKVCacheCustomInstanceHistoryMonitorValuesResponse {
  var runtime = new $RuntimeOptions{};
  return describeTairKVCacheCustomInstanceHistoryMonitorValuesWithOptions(request, runtime);
}

model DescribeTairKVCacheCustomInstancesRequest {
  chargeType?: string(name='ChargeType', example='PrePaid'),
  expired?: string(name='Expired', example='false'),
  instanceClass?: string(name='InstanceClass', example='tair.gpu.test.16g'),
  instanceIds?: string(name='InstanceIds', example='tc-bp16e70a4338****'),
  instanceStatus?: string(name='InstanceStatus', example='Normal'),
  instanceType?: string(name='InstanceType', example='TairCustom'),
  networkType?: string(name='NetworkType', example='VPC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  privateIp?: string(name='PrivateIp'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  searchKey?: string(name='SearchKey', example='apitest'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key', example='key1_test'),
      value?: string(name='Value', example='value1_test'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', example='cn-hangzhou-h'),
}

model DescribeTairKVCacheCustomInstancesResponseBody = {
  instances?: {
    KVStoreInstance?: [ 
    {
      chargeType?: string(name='ChargeType', example='PrePaid'),
      createTime?: string(name='CreateTime', example='2018-11-07T08:49:00Z'),
      destroyTime?: string(name='DestroyTime', example='2019-04-28T10:03:01Z'),
      endTime?: string(name='EndTime', example='2024-05-21T00:00:00Z'),
      instanceClass?: string(name='InstanceClass', example='tair.gpu.test.16g'),
      instanceId?: string(name='InstanceId', example='tc-bp1zxszhcgatnx****'),
      instanceName?: string(name='InstanceName', example='testdb'),
      instanceStatus?: string(name='InstanceStatus', example='Normal'),
      instanceType?: string(name='InstanceType', example='TairCustom'),
      networkType?: string(name='NetworkType', example='VPC'),
      privateIp?: string(name='PrivateIp'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyiu4ekp****'),
      storage?: long(name='Storage', example='50'),
      storageType?: string(name='StorageType', example='essd_pl1'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', example='tagkey'),
          value?: string(name='Value', example='tagvalue'),
        }
      ](name='Tag')
      }(name='Tags'),
      useEni?: boolean(name='UseEni'),
      vSwitchId?: string(name='VSwitchId', example='vsw-bp1e7clcw529l773d****'),
      vpcId?: string(name='VpcId', example='vpc-bp1nme44gek34slfc****'),
      zoneId?: string(name='ZoneId', example='cn-hangzhou-e'),
    }
  ](name='KVStoreInstance')
  }(name='Instances'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  requestId?: string(name='RequestId', example='B79C1A90-495B-4E99-A2AA-A4DB13B8****'),
  totalCount?: int32(name='TotalCount', example='40'),
}

model DescribeTairKVCacheCustomInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTairKVCacheCustomInstancesResponseBody(name='body'),
}

/**
 * @summary 查看TairCustom实例
 *
 * @param request DescribeTairKVCacheCustomInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTairKVCacheCustomInstancesResponse
 */
async function describeTairKVCacheCustomInstancesWithOptions(request: DescribeTairKVCacheCustomInstancesRequest, runtime: $RuntimeOptions): DescribeTairKVCacheCustomInstancesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTairKVCacheCustomInstances',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查看TairCustom实例
 *
 * @param request DescribeTairKVCacheCustomInstancesRequest
 * @return DescribeTairKVCacheCustomInstancesResponse
 */
async function describeTairKVCacheCustomInstances(request: DescribeTairKVCacheCustomInstancesRequest): DescribeTairKVCacheCustomInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeTairKVCacheCustomInstancesWithOptions(request, runtime);
}

model DescribeTairKVCacheInferInstanceAttributeRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeTairKVCacheInferInstanceAttributeResponseBody = {
  instances?: {
    DBInstanceAttribute?: [ 
    {
      architectureType?: string(name='ArchitectureType'),
      chargeType?: string(name='ChargeType'),
      connectionString?: string(name='ConnectionString'),
      createTime?: string(name='CreateTime'),
      endTime?: string(name='EndTime'),
      instanceClass?: string(name='InstanceClass'),
      instanceId?: string(name='InstanceId'),
      instanceName?: string(name='InstanceName'),
      instanceStatus?: string(name='InstanceStatus'),
      instanceType?: string(name='InstanceType'),
      isDelete?: int32(name='IsDelete'),
      isOrderCompleted?: string(name='IsOrderCompleted'),
      networkType?: string(name='NetworkType'),
      privateIp?: string(name='PrivateIp'),
      regionId?: string(name='RegionId'),
      reserveGpuNum?: int32(name='ReserveGpuNum'),
      resourceGroupId?: string(name='ResourceGroupId'),
      securityGroupId?: string(name='SecurityGroupId'),
      storage?: long(name='Storage'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      vSwitchId?: string(name='VSwitchId'),
      vpcId?: string(name='VpcId'),
      zoneId?: string(name='ZoneId'),
      zoneType?: string(name='ZoneType'),
    }
  ](name='DBInstanceAttribute')
  }(name='Instances'),
  requestId?: string(name='RequestId'),
}

model DescribeTairKVCacheInferInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTairKVCacheInferInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary 查看TairInfer实例
 *
 * @param request DescribeTairKVCacheInferInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTairKVCacheInferInstanceAttributeResponse
 */
async function describeTairKVCacheInferInstanceAttributeWithOptions(request: DescribeTairKVCacheInferInstanceAttributeRequest, runtime: $RuntimeOptions): DescribeTairKVCacheInferInstanceAttributeResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTairKVCacheInferInstanceAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查看TairInfer实例
 *
 * @param request DescribeTairKVCacheInferInstanceAttributeRequest
 * @return DescribeTairKVCacheInferInstanceAttributeResponse
 */
async function describeTairKVCacheInferInstanceAttribute(request: DescribeTairKVCacheInferInstanceAttributeRequest): DescribeTairKVCacheInferInstanceAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return describeTairKVCacheInferInstanceAttributeWithOptions(request, runtime);
}

model DescribeTairKVCacheInferInstancesRequest {
  chargeType?: string(name='ChargeType'),
  expired?: string(name='Expired'),
  instanceClass?: string(name='InstanceClass'),
  instanceIds?: string(name='InstanceIds'),
  instanceStatus?: string(name='InstanceStatus'),
  networkType?: string(name='NetworkType'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  privateIp?: string(name='PrivateIp'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  searchKey?: string(name='SearchKey'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  vSwitchId?: string(name='VSwitchId'),
  vpcId?: string(name='VpcId'),
  zoneId?: string(name='ZoneId'),
}

model DescribeTairKVCacheInferInstancesResponseBody = {
  instances?: {
    tairInferInstanceDTO?: [ 
    {
      capacity?: long(name='Capacity'),
      chargeType?: string(name='ChargeType'),
      createTime?: string(name='CreateTime'),
      destroyTime?: string(name='DestroyTime'),
      endTime?: string(name='EndTime'),
      instanceClass?: string(name='InstanceClass'),
      instanceId?: string(name='InstanceId'),
      instanceName?: string(name='InstanceName'),
      instanceStatus?: string(name='InstanceStatus'),
      instanceType?: string(name='InstanceType'),
      moduleName?: string(name='ModuleName'),
      networkType?: string(name='NetworkType'),
      privateIp?: string(name='PrivateIp'),
      regionId?: string(name='RegionId'),
      reserveGpuNum?: int32(name='ReserveGpuNum'),
      resourceGroupId?: string(name='ResourceGroupId'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      usedGpuNum?: int32(name='UsedGpuNum'),
      vSwitchId?: string(name='VSwitchId'),
      vpcId?: string(name='VpcId'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='TairInferInstanceDTO')
  }(name='Instances'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeTairKVCacheInferInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTairKVCacheInferInstancesResponseBody(name='body'),
}

/**
 * @summary 查看TairInfer实例列表
 *
 * @param request DescribeTairKVCacheInferInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTairKVCacheInferInstancesResponse
 */
async function describeTairKVCacheInferInstancesWithOptions(request: DescribeTairKVCacheInferInstancesRequest, runtime: $RuntimeOptions): DescribeTairKVCacheInferInstancesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTairKVCacheInferInstances',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查看TairInfer实例列表
 *
 * @param request DescribeTairKVCacheInferInstancesRequest
 * @return DescribeTairKVCacheInferInstancesResponse
 */
async function describeTairKVCacheInferInstances(request: DescribeTairKVCacheInferInstancesRequest): DescribeTairKVCacheInferInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeTairKVCacheInferInstancesWithOptions(request, runtime);
}

model DescribeTasksRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2020-11-26T01:00Z'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query instance IDs.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than **0** and does not exceed the maximum value of the Integer data type. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**. Default value: **30**.', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2020-11-20T01:00Z'),
  status?: string(name='Status', description='The status of the task. Separate multiple values with commas (,). Valid values:

*   **0**: The task is pending.
*   **1**: The task is running.
*   **2**: The task is complete.
*   **4**: The task is closed.
*   **7**: The task is paused.
*   **8**: The task is interrupted.

This parameter is required.', example='2'),
}

model DescribeTasksResponseBody = {
  items?: [ 
    {
      beginTime?: string(name='BeginTime', description='The beginning time of the task. The time follows the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-11-13T06:16:54Z'),
      currentStepName?: string(name='CurrentStepName', description='The name of the subtask.', example='init_redis'),
      finishTime?: string(name='FinishTime', description='The end time of the task. The time follows the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-11-13T06:17:18Z'),
      progress?: float(name='Progress', description='The progress of the task. Unit: %.', example='100'),
      remain?: int32(name='Remain', description='The estimated remaining duration of the task. Unit: seconds.

>  If the task is not running, this parameter is not returned or the returned value is **0**.', example='60'),
      status?: string(name='Status', description='The status of the task. Valid values:

*   **0**: The task is pending.
*   **1**: The task is running.
*   **2**: The task is complete.
*   **4**: The task is closed.
*   **7**: The task is paused.
*   **8**: The task is interrupted.', example='2'),
      stepProgressInfo?: string(name='StepProgressInfo', description='The progress of the subtask.

>  If the subtask does not exist, this parameter is not returned.', example='3/3'),
      stepsInfo?: string(name='StepsInfo', description='The information about the subtask in the JSON format. This includes the expected remaining duration (**remain**), the name of the subtask (**name**), and the task progress (**progress**).

>  If the subtask does not exist, this parameter is not returned.', example='[{\\\\"remain\\\\":0,\\\\"name\\\\":\\\\"init_instance\\\\",\\\\"progress\\\\":100},{\\\\"remain\\\\":107,\\\\"name\\\\":\\\\"init_redis\\\\",\\\\"progress\\\\":12.3},{\\\\"remain\\\\":1881,\\\\"name\\\\":\\\\"init_config\\\\",\\\\"progress\\\\":0}]'),
      taskAction?: string(name='TaskAction', description='The identifier of the task.', example='ModifyDBInstanceParameter'),
      taskId?: string(name='TaskId', description='The ID of the task.', example='32302****'),
    }
  ](name='Items', description='The details of the task.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='608FAEC9-485E-4C65-82DE-2E5B955E****'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries.', example='2'),
}

model DescribeTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTasksResponseBody(name='body'),
}

/**
 * @summary Queries all tasks that are performed on a Tair (Redis OSS-compatible) instance within a specified period of time.
 *
 * @description You can call this operation to query the progress of a task when you perform time-consuming operations. You can also log on to the Tair (Redis OSS-compatible) console and click the Tasks icon in the upper-right corner of the **Instance Information** page to view the progress of the current task.
 *
 * @param request DescribeTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTasksResponse
 */
async function describeTasksWithOptions(request: DescribeTasksRequest, runtime: $RuntimeOptions): DescribeTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTasks',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries all tasks that are performed on a Tair (Redis OSS-compatible) instance within a specified period of time.
 *
 * @description You can call this operation to query the progress of a task when you perform time-consuming operations. You can also log on to the Tair (Redis OSS-compatible) console and click the Tasks icon in the upper-right corner of the **Instance Information** page to view the progress of the current task.
 *
 * @param request DescribeTasksRequest
 * @return DescribeTasksResponse
 */
async function describeTasks(request: DescribeTasksRequest): DescribeTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeTasksWithOptions(request, runtime);
}

model DescribeZonesRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The display language of the zone names to return. Valid values:

*   **zh-CN** (default): Chinese
*   **en-US**: English', example='en-US'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-huhehaote'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeZonesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1D42F072-72FE-4DC4-BB8E-64B1D298****'),
  zones?: {
    KVStoreZone?: [ 
    {
      disabled?: boolean(name='Disabled', description='Indicates whether Tair (Redis OSS-compatible) instances can be created in the current zone. Valid values:

*   **true**: Tair (Redis OSS-compatible) instances cannot be created in the current zone.
*   **false**: Tair (Redis OSS-compatible) instances can be created in the current zone.', example='true'),
      isRds?: boolean(name='IsRds', description='Indicates whether the zone is managed by ApsaraDB RDS. The return value of this parameter is **true** in Tair (Redis OSS-compatible).', example='true'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-huhehaote'),
      switchNetwork?: boolean(name='SwitchNetwork', description='Indicates whether the network type of the instance can be changed from the classic network to Virtual Private Cloud (VPC). Valid values:

*   **true**: The network type of the instance can be changed from the classic network to VPC.
*   **false**: The network type of the instance cannot be changed from the classic network to VPC.', example='true'),
      zoneId?: string(name='ZoneId', description='The ID of the zone within the specified region.', example='cn-huhehaote-b'),
      zoneName?: string(name='ZoneName', description='The name of the zone within the specified region.', example='Hohhot Zone B'),
    }
  ](name='KVStoreZone')
  }(name='Zones', description='The queried zones.'),
}

model DescribeZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZonesResponseBody(name='body'),
}

/**
 * @summary Queries the zones available for Tair (Redis OSS-compatible).
 *
 * @param request DescribeZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZonesResponse
 */
async function describeZonesWithOptions(request: DescribeZonesRequest, runtime: $RuntimeOptions): DescribeZonesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeZones',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the zones available for Tair (Redis OSS-compatible).
 *
 * @param request DescribeZonesRequest
 * @return DescribeZonesResponse
 */
async function describeZones(request: DescribeZonesRequest): DescribeZonesResponse {
  var runtime = new $RuntimeOptions{};
  return describeZonesWithOptions(request, runtime);
}

model EnableAdditionalBandwidthRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Default value: true. Valid values:

*   **true**: enables automatic payment. Make sure that you have sufficient balance within your account.
*   **false**: disables automatic payment. If automatic payment is disabled, you must perform the following steps to complete the payment in the Tair (Redis OSS-compatible) console: In the top navigation bar, choose **Expenses** > **Renewal Management**. In the left-side navigation pane, click **Orders**. On the **Orders** page, find the order and complete the payment.', example='true'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal. Valid values:

*   **true**: enables auto-renewal.
*   **false**: disables auto-renewal. This is the default value.', example='false'),
  autoRenewPeriod?: int32(name='AutoRenewPeriod', description='The auto-renewal cycle based on which Tair (Redis OSS-compatible) automatically renews the purchased bandwidth. Unit: months. Valid values: **1**, **2**, **3**, **4**, **5**, **6**, **7**, **8**, **9**, **12**, **24**, **36**, and **60**.

> * This parameter takes effect and must be specified only when you set the **AutoRenew** parameter to **true**.
> * You cannot query the auto-renewal cycle by calling an API operation. To obtain the auto-renewal cycle, you can perform the following procedure: In the top navigation bar of the Tair (Redis OSS-compatible) console, choose **Expenses** > **Renewal Management**. On the page that appears, enter the ID of the instance and the `-bw` suffix in the **Instance ID** field. Example: r-bp1zxszhcgatnx****-bw.', example='1'),
  bandwidth?: string(name='Bandwidth', description='The amount of extra bandwidth that you want to purchase. Unit: Mbit/s. The value must be an integer greater than or equal to **0**. The maximum value can be up to six times the default bandwidth of the instance or a single shard, but cannot exceed 192 Mbit/s. For example, if the default bandwidth of an instance is 10 Mbit/s, the value range of this parameter is **0** to **60**.

> *   You can call the [DescribeRoleZoneInfo](https://help.aliyun.com/document_detail/473782.html) operation to obtain the default maximum bandwidth returned by the **DefaultBandWidth** response parameter. For more information about instance types, see [Overview](https://help.aliyun.com/document_detail/26350.html).
> -   If you specify multiple data shard IDs in the **NodeId** parameter, you must specify the amount of bandwidth that you want to purchase for each specified data shard in the Bandwidth parameter. The bandwidth values that you specify in the Bandwidth parameter must be in the same sequence as the data shard IDs that you specify in the NodeId parameter. In addition, you must separate the bandwidth values with commas (,).', example='20'),
  chargeType?: string(name='ChargeType', description='The billing method of the bandwidth instance. Default value: PostPaid. Valid values:

- PrePaid: subscription
- PostPaid: pay-as-you-go', example='PostPaid'),
  couponNo?: string(name='CouponNo', description='The coupon ID.', example='youhuiquan_promotion_option_id_for_blank'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the IDs of instances.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the data shard for which you want to purchase a specific amount of bandwidth. You can call the [DescribeLogicInstanceTopology](https://help.aliyun.com/document_detail/473786.html) operation to query the IDs of the data shards in an instance. If you specify multiple data shard IDs, separate the data shard IDs with commas (,). You can also set this parameter to **All**, which specifies all the data shards of the instance.

>  This parameter is valid and required only if the instance is a [cluster](https://help.aliyun.com/document_detail/52228.html) instance or [read/write splitting](https://help.aliyun.com/document_detail/62870.html) instance.', example='r-bp1zxszhcgatnx****-db-0'),
  orderTimeLength?: string(name='OrderTimeLength', description='The validity period of the bandwidth that you purchase. Unit: day. Valid values: **1**, **2**, **3**, **7**, **14**, **30**, **60**, **90**, **180**, **365**, **730**, **1095**, and **1825**.

> If you want to continue using the purchased bandwidth after the specified period of time elapses, you must call the [RenewAdditionalBandwidth](https://help.aliyun.com/document_detail/473804.html) operation to submit a renewal order.', example='30'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='The source of the operation. This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
}

model EnableAdditionalBandwidthResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='2084452111111'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model EnableAdditionalBandwidthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableAdditionalBandwidthResponseBody(name='body'),
}

/**
 * @summary Adjusts the bandwidth of a Tair (Redis OSS-compatible) instance. Only the pay-as-you-go billing method is supported for bandwidth adjustment. You need to specify the InstanceId, NodeId (optional), Bandwidth, and ChargeType parameters.
 *
 * @description If you enable the bandwidth auto scaling feature and call this operation at the same time, bandwidth auto scaling takes precedence. During bandwidth scale-back, the instance is scaled back to the default bandwidth of the instance type. For more information about the limits, costs, and FAQ about this feature, see [Adjust the bandwidth of an instance](https://help.aliyun.com/document_detail/102588.html).
 * >  Before you call this operation, you can call the [DescribeRoleZoneInfo](https://help.aliyun.com/document_detail/473782.html) operation to query the current bandwidth of each data node in an instance.
 *
 * @param request EnableAdditionalBandwidthRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableAdditionalBandwidthResponse
 */
async function enableAdditionalBandwidthWithOptions(request: EnableAdditionalBandwidthRequest, runtime: $RuntimeOptions): EnableAdditionalBandwidthResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.autoRenewPeriod)) {
    query['AutoRenewPeriod'] = request.autoRenewPeriod;
  }
  if (!$isNull(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!$isNull(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.orderTimeLength)) {
    query['OrderTimeLength'] = request.orderTimeLength;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableAdditionalBandwidth',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adjusts the bandwidth of a Tair (Redis OSS-compatible) instance. Only the pay-as-you-go billing method is supported for bandwidth adjustment. You need to specify the InstanceId, NodeId (optional), Bandwidth, and ChargeType parameters.
 *
 * @description If you enable the bandwidth auto scaling feature and call this operation at the same time, bandwidth auto scaling takes precedence. During bandwidth scale-back, the instance is scaled back to the default bandwidth of the instance type. For more information about the limits, costs, and FAQ about this feature, see [Adjust the bandwidth of an instance](https://help.aliyun.com/document_detail/102588.html).
 * >  Before you call this operation, you can call the [DescribeRoleZoneInfo](https://help.aliyun.com/document_detail/473782.html) operation to query the current bandwidth of each data node in an instance.
 *
 * @param request EnableAdditionalBandwidthRequest
 * @return EnableAdditionalBandwidthResponse
 */
async function enableAdditionalBandwidth(request: EnableAdditionalBandwidthRequest): EnableAdditionalBandwidthResponse {
  var runtime = new $RuntimeOptions{};
  return enableAdditionalBandwidthWithOptions(request, runtime);
}

model FlushExpireKeysRequest {
  effectiveTime?: string(name='EffectiveTime', description='The time when you want to delete the expired keys. Default value: Immediately. Valid values:

*   **Immediately**: deletes the keys immediately.
*   **MaintainTime**: deletes the keys during the maintenance window.

>  You can call the [ModifyInstanceMaintainTime](https://help.aliyun.com/document_detail/473775.html) operation to modify the maintenance window of an instance.', example='Immediately'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model FlushExpireKeysResponseBody = {
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='82E30AB7-E3A4-46AC-88A0-3E4DCDC5****'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='21986****'),
}

model FlushExpireKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FlushExpireKeysResponseBody(name='body'),
}

/**
 * @summary Clears all expired keys in a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about how to clear the expired keys in the Tair (Redis OSS-compatible) console, see [Clear data](https://help.aliyun.com/document_detail/43881.html).
 * >  Expired keys cannot be recovered after they are deleted. Exercise caution when you call this operation.
 *
 * @param request FlushExpireKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FlushExpireKeysResponse
 */
async function flushExpireKeysWithOptions(request: FlushExpireKeysRequest, runtime: $RuntimeOptions): FlushExpireKeysResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'FlushExpireKeys',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Clears all expired keys in a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about how to clear the expired keys in the Tair (Redis OSS-compatible) console, see [Clear data](https://help.aliyun.com/document_detail/43881.html).
 * >  Expired keys cannot be recovered after they are deleted. Exercise caution when you call this operation.
 *
 * @param request FlushExpireKeysRequest
 * @return FlushExpireKeysResponse
 */
async function flushExpireKeys(request: FlushExpireKeysRequest): FlushExpireKeysResponse {
  var runtime = new $RuntimeOptions{};
  return flushExpireKeysWithOptions(request, runtime);
}

model FlushInstanceRequest {
  instanceId?: string(name='InstanceId', description='The ID of the request.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model FlushInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The operation that you want to perform. Set the value to **FlushInstance**.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B3E7'),
}

model FlushInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FlushInstanceResponseBody(name='body'),
}

/**
 * @summary Clears the data of a Tair (Redis OSS-compatible) instance. The cleared data cannot be restored.
 *
 * @param request FlushInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FlushInstanceResponse
 */
async function flushInstanceWithOptions(request: FlushInstanceRequest, runtime: $RuntimeOptions): FlushInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'FlushInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Clears the data of a Tair (Redis OSS-compatible) instance. The cleared data cannot be restored.
 *
 * @param request FlushInstanceRequest
 * @return FlushInstanceResponse
 */
async function flushInstance(request: FlushInstanceRequest): FlushInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return flushInstanceWithOptions(request, runtime);
}

model FlushInstanceForDBRequest {
  dbIndex?: int32(name='DbIndex', description='The index number of the database. Valid values: 0 to 255.

This parameter is required.', example='1'),
  instanceId?: string(name='InstanceId', description='The instance ID. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model FlushInstanceForDBResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model FlushInstanceForDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FlushInstanceForDBResponseBody(name='body'),
}

/**
 * @summary Cleans the data of specified databases in a Tair (Redis OSS-compatible) instance.
 *
 * @description Each Tair (Redis OSS-compatible) instance can contain up to 256 databases named from DB0 to DB255. Each database does not have a separate memory usage limit. The memory capacity that a database can use is subject to the total memory limit of the instance. You can execute the `SELECT` statement to switch between databases. For more information, see [What is the size of each database on a Tair (Redis OSS-compatible) instance, and how can I choose databases?](https://help.aliyun.com/document_detail/38688.html)
 * >  This operation is available only for cloud-native instances that use cloud disks.
 *
 * @param request FlushInstanceForDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FlushInstanceForDBResponse
 */
async function flushInstanceForDBWithOptions(request: FlushInstanceForDBRequest, runtime: $RuntimeOptions): FlushInstanceForDBResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbIndex)) {
    query['DbIndex'] = request.dbIndex;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'FlushInstanceForDB',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Cleans the data of specified databases in a Tair (Redis OSS-compatible) instance.
 *
 * @description Each Tair (Redis OSS-compatible) instance can contain up to 256 databases named from DB0 to DB255. Each database does not have a separate memory usage limit. The memory capacity that a database can use is subject to the total memory limit of the instance. You can execute the `SELECT` statement to switch between databases. For more information, see [What is the size of each database on a Tair (Redis OSS-compatible) instance, and how can I choose databases?](https://help.aliyun.com/document_detail/38688.html)
 * >  This operation is available only for cloud-native instances that use cloud disks.
 *
 * @param request FlushInstanceForDBRequest
 * @return FlushInstanceForDBResponse
 */
async function flushInstanceForDB(request: FlushInstanceForDBRequest): FlushInstanceForDBResponse {
  var runtime = new $RuntimeOptions{};
  return flushInstanceForDBWithOptions(request, runtime);
}

model GrantAccountPrivilegeRequest {
  accountName?: string(name='AccountName', description='The name of the account. You can call the [DescribeAccounts](~~DescribeAccounts~~) operation to obtain the name of the account.

This parameter is required.', example='demoaccount'),
  accountPrivilege?: string(name='AccountPrivilege', description='The permissions of the account. Default value: RoleReadWrite. Valid values:

*   RoleReadOnly: The account has the read-only permissions.
*   RoleReadWrite: The account has the read and write permissions.

This parameter is required.', example='RoleReadWrite'),
  instanceId?: string(name='InstanceId', description='The ID of the instance to which the account belongs.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
}

model GrantAccountPrivilegeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='3845BDF5-15A6-4444-B770-78501819****'),
}

model GrantAccountPrivilegeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GrantAccountPrivilegeResponseBody(name='body'),
}

/**
 * @summary Modifies the permissions of an account for a Tair (Redis OSS-compatible) instance.
 *
 * @description > 
 * *   Only Tair (Redis OSS-compatible) instances of Redis 4.0 or later are supported.
 * *   The Tair (Redis OSS-compatible) instance must be in the running state.
 *
 * @param request GrantAccountPrivilegeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GrantAccountPrivilegeResponse
 */
async function grantAccountPrivilegeWithOptions(request: GrantAccountPrivilegeRequest, runtime: $RuntimeOptions): GrantAccountPrivilegeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPrivilege)) {
    query['AccountPrivilege'] = request.accountPrivilege;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GrantAccountPrivilege',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the permissions of an account for a Tair (Redis OSS-compatible) instance.
 *
 * @description > 
 * *   Only Tair (Redis OSS-compatible) instances of Redis 4.0 or later are supported.
 * *   The Tair (Redis OSS-compatible) instance must be in the running state.
 *
 * @param request GrantAccountPrivilegeRequest
 * @return GrantAccountPrivilegeResponse
 */
async function grantAccountPrivilege(request: GrantAccountPrivilegeRequest): GrantAccountPrivilegeResponse {
  var runtime = new $RuntimeOptions{};
  return grantAccountPrivilegeWithOptions(request, runtime);
}

model InitializeKvstorePermissionRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model InitializeKvstorePermissionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model InitializeKvstorePermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitializeKvstorePermissionResponseBody(name='body'),
}

/**
 * @summary Assigns a service-linked role to ApsaraDB for Redis.
 *
 * @description The log management feature of ApsaraDB for Redis requires the resources of [Log Service](https://help.aliyun.com/document_detail/48869.html). To use the log management feature of ApsaraDB for Redis, you can call this operation to associate the RAM role named AliyunServiceRoleForKvstore with the ApsaraDB for Redis instance. For more information, see [Associated RAM roles of ApsaraDB for Redis](https://help.aliyun.com/document_detail/184337.html).
 *
 * @param request InitializeKvstorePermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InitializeKvstorePermissionResponse
 */
async function initializeKvstorePermissionWithOptions(request: InitializeKvstorePermissionRequest, runtime: $RuntimeOptions): InitializeKvstorePermissionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'InitializeKvstorePermission',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Assigns a service-linked role to ApsaraDB for Redis.
 *
 * @description The log management feature of ApsaraDB for Redis requires the resources of [Log Service](https://help.aliyun.com/document_detail/48869.html). To use the log management feature of ApsaraDB for Redis, you can call this operation to associate the RAM role named AliyunServiceRoleForKvstore with the ApsaraDB for Redis instance. For more information, see [Associated RAM roles of ApsaraDB for Redis](https://help.aliyun.com/document_detail/184337.html).
 *
 * @param request InitializeKvstorePermissionRequest
 * @return InitializeKvstorePermissionResponse
 */
async function initializeKvstorePermission(request: InitializeKvstorePermissionRequest): InitializeKvstorePermissionResponse {
  var runtime = new $RuntimeOptions{};
  return initializeKvstorePermissionWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='The token used to start the next query to retrieve more results.

> This parameter is not required in the first query. If not all results are returned in one query, you can specify the **NextToken** value returned for the query to perform the next query.', example='212db86sca4384811e0b5e8707ec2****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The IDs of the instances.

> *   You must specify this parameter or the **Tag** parameter.', example='r-bp1zxszhcgatnx****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **INSTANCE**.

This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The keys of the tags associated with the instances you want to query.', example='demokey'),
      value?: string(name='Value', description='The values of the tags associated with the instances you want to query.', example='demovalue'),
    }
  ](name='Tag', description='The tags of the instance. You must specify this parameter or the **ResourceId** parameter.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The token required to obtain more results. If a query does not return all results, in the next query, you can provide the token returned by the previous query to obtain more results.', example='212db86sca4384811e0b5e8707ec2****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='47A514A1-4B77-4E30-B4C5-2A880650****'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The resource ID, which is also the ID of the instance.', example='r-bp1zxszhcgatnx****'),
      resourceType?: string(name='ResourceType', description='The resource type. The return value is **ALIYUN::KVSTORE::INSTANCE**. This value indicates a Tair (Redis OSS-compatible) instance.', example='ALIYUN::KVSTORE::INSTANCE'),
      tagKey?: string(name='TagKey', description='The keys of the tags.', example='demokey'),
      tagValue?: string(name='TagValue', description='The values of the tags.', example='demovalue'),
    }
  ](name='TagResource')
  }(name='TagResources', description='Details about the instances and tags.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the relationships between Tair (Redis OSS-compatible) instances and tags.
 *
 * @description You can also query the relationships between instances and tags in the Tair (Redis OSS-compatible) console. For more information, see [Filter Tair (Redis OSS-compatible) instances by tag](https://help.aliyun.com/document_detail/119160.html) and [View tags bound to an instance](https://help.aliyun.com/document_detail/134038.html).
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the relationships between Tair (Redis OSS-compatible) instances and tags.
 *
 * @description You can also query the relationships between instances and tags in the Tair (Redis OSS-compatible) console. For more information, see [Filter Tair (Redis OSS-compatible) instances by tag](https://help.aliyun.com/document_detail/119160.html) and [View tags bound to an instance](https://help.aliyun.com/document_detail/134038.html).
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model LockDBInstanceWriteRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  lockReason?: string(name='LockReason', description='The reason why write operations on the instance are locked.

This parameter is required.', example='lock reason'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model LockDBInstanceWriteResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', description='The instance ID.', example='r-2ev03avw0r0552***'),
  lockReason?: string(name='LockReason', description='The reason why write operations on the instance are locked.', example='lock reason'),
  requestId?: string(name='RequestId', description='The request ID.', example='2BE6E619-A657-42E3-AD2D-18F8428A****'),
  taskId?: long(name='TaskId', description='The task ID.', example='21986****'),
}

model LockDBInstanceWriteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LockDBInstanceWriteResponseBody(name='body'),
}

/**
 * @summary Places a write lock on an instance. After the instance is locked, it supports only read operations.
 *
 * @param request LockDBInstanceWriteRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LockDBInstanceWriteResponse
 */
async function lockDBInstanceWriteWithOptions(request: LockDBInstanceWriteRequest, runtime: $RuntimeOptions): LockDBInstanceWriteResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.lockReason)) {
    query['LockReason'] = request.lockReason;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'LockDBInstanceWrite',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Places a write lock on an instance. After the instance is locked, it supports only read operations.
 *
 * @param request LockDBInstanceWriteRequest
 * @return LockDBInstanceWriteResponse
 */
async function lockDBInstanceWrite(request: LockDBInstanceWriteRequest): LockDBInstanceWriteResponse {
  var runtime = new $RuntimeOptions{};
  return lockDBInstanceWriteWithOptions(request, runtime);
}

model MasterNodeShutDownFailOverRequest {
  category?: string(name='Category', description='The resource category. Set the value to instance.', example='instance'),
  DBFaultMode?: string(name='DBFaultMode', description='*   Specify: This mode allows you to specify a database node to use.
*   Random: In this mode, a random database node is selected when no database node is specified.', example='Random'),
  DBNodes?: string(name='DBNodes', description='The IDs of the database nodes.', example='r-rdsdavinx01003-db-0,r-rdsdavinx01003-db-1'),
  failMode?: string(name='FailMode', description='*   **Hard**: stimulates a hardware failure that cannot be recovered. In this case, a high-availability switchover is triggered.
*   **Soft** (default): stimulates a hardware failure that can be recovered. In this case, the system first attempts to recover the faulty node. If the attempt fails, a high-availability switchover is triggered.

Valid values:

*   Safe
*   UnSafe
*   Hard
*   Soft', example='Safe'),
  instanceId?: string(name='InstanceId', description='The instance ID. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  proxyFaultMode?: string(name='ProxyFaultMode', description='*   Specify: This mode allows you to specify a proxy node to use.
*   Random: In this mode, a random proxy node is selected when no proxy node is specified.', example='Specify'),
  proxyInstanceIds?: string(name='ProxyInstanceIds', description='The IDs of the proxy nodes.', example='6981,6982'),
}

model MasterNodeShutDownFailOverResponseBody = {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The request ID.', example='12123216-4B00-4378-BE4B-08005BFC****'),
  taskID?: string(name='TaskID', description='The task ID.', example='17566'),
}

model MasterNodeShutDownFailOverResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MasterNodeShutDownFailOverResponseBody(name='body'),
}

/**
 * @summary Simulates database node failures.
 *
 * @param request MasterNodeShutDownFailOverRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MasterNodeShutDownFailOverResponse
 */
async function masterNodeShutDownFailOverWithOptions(request: MasterNodeShutDownFailOverRequest, runtime: $RuntimeOptions): MasterNodeShutDownFailOverResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.DBFaultMode)) {
    query['DBFaultMode'] = request.DBFaultMode;
  }
  if (!$isNull(request.DBNodes)) {
    query['DBNodes'] = request.DBNodes;
  }
  if (!$isNull(request.failMode)) {
    query['FailMode'] = request.failMode;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.proxyFaultMode)) {
    query['ProxyFaultMode'] = request.proxyFaultMode;
  }
  if (!$isNull(request.proxyInstanceIds)) {
    query['ProxyInstanceIds'] = request.proxyInstanceIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MasterNodeShutDownFailOver',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Simulates database node failures.
 *
 * @param request MasterNodeShutDownFailOverRequest
 * @return MasterNodeShutDownFailOverResponse
 */
async function masterNodeShutDownFailOver(request: MasterNodeShutDownFailOverRequest): MasterNodeShutDownFailOverResponse {
  var runtime = new $RuntimeOptions{};
  return masterNodeShutDownFailOverWithOptions(request, runtime);
}

model MigrateToOtherZoneRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the Tair (Redis OSS-compatible) instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  effectiveTime?: string(name='EffectiveTime', description='The time when the database is switched after the instance is migrated. Valid values:

*   **Immediately**: The database is immediately switched after the instance is migrated.
*   **MaintainTime**: The database is switched within the maintenance window.

>  Default value: Immediately.', example='Immediately'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  readOnlyCount?: int32(name='ReadOnlyCount', description='The number of read replicas in the primary zone.

> 

*   The **ReadOnlyCount** and **SlaveReadOnlyCount** parameters are applicable only to cloud-native instances for which read/write splitting is enabled. When you migrate an instance to multiple zones, you can use these parameters to adjust the distribution of read replicas in the primary and secondary zones of the instance. This operation does not allow you to increase or decrease the number of nodes. Therefore, the sum of the values of `ReadOnlyCount and SlaveReadOnlyCount` must be the same as that before the migration.

*   If you do not specify these parameters when you migrate an instance from a single zone to multiple zones, one read replica is migrated to the secondary zone, and all other read replicas remain in the primary zone.

*   If the instance is a cluster instance, the preceding parameters indicate the number of read replicas per shard in the primary and secondary zones of the instance.', example='1'),
  replicaCount?: int32(name='ReplicaCount', description='The number of replica nodes in the primary zone.

> 

*   The **ReplicaCount** and **SlaveReplicaCount** parameters are applicable only to cloud-native instances. When you migrate an instance to multiple zones, you can use these parameters to adjust the distribution of replica nodes in the primary and secondary zones of the instance. This operation does not allow you to increase or decrease the number of nodes. Therefore, the sum of the values of `ReplicaCount and SlaveReplicaCount` must be the same as that before the migration.

*   If you do not specify these parameters when you migrate an instance from a single zone to multiple zones, one replica node is migrated to the secondary zone, and all other replica nodes remain in the primary zone.

*   If the instance is a cluster instance, the preceding parameters indicate the number of replica nodes per shard in the primary and secondary zones of the instance.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the secondary zone to which you want to migrate the instance. You can call the [DescribeZones](https://help.aliyun.com/document_detail/473764.html) operation to query zone IDs.

>  If you specify this parameter, the master node and replica node of the instance can be deployed in different zones and disaster recovery is implemented across zones. The instance can withstand failures in data centers.', example='cn-hangzhou-h'),
  securityToken?: string(name='SecurityToken'),
  slaveReadOnlyCount?: int32(name='SlaveReadOnlyCount', description='The number of read replicas in the secondary zone.', example='1'),
  slaveReplicaCount?: int32(name='SlaveReplicaCount', description='The number of replica nodes in the secondary zone.', example='1'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.

> 

*   The zone where the vSwitch resides must be the same as the ID of the destination zone.

*   If the network type of the instance is VPC, this parameter is required.', example='vsw-bp1e7clcw529l773d****'),
  zoneId?: string(name='ZoneId', description='The ID of the destination primary zone. You can call the [DescribeZones](https://help.aliyun.com/document_detail/473764.html) operation to query zone IDs.

This parameter is required.', example='cn-hangzhou-g'),
}

model MigrateToOtherZoneResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='29B0BF34-D069-4495-92C7-FA6D9452****'),
}

model MigrateToOtherZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MigrateToOtherZoneResponseBody(name='body'),
}

/**
 * @summary Migrates a Tair (Redis OSS-compatible) instance to another zone in the same region.
 *
 * @description Before you call this operation, you must release the public endpoint (if any) of the instance. For more information, see [Migrate an instance across zones](https://help.aliyun.com/document_detail/106272.html).
 * > 
 * *   If the network type of an Tair (Redis OSS-compatible) instance is switched from classic network to Virtual Private Cloud (VPC), and the classic network endpoint is retained, you can migrate the instance across zones only after the classic network endpoint is released upon expiration.
 * *   After the instance is migrated, the endpoint of the instance remains unchanged. However, the virtual IP address (VIP) is changed. We recommend that you use the endpoint instead of the VIP to connect to the instance.
 *
 * @param request MigrateToOtherZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MigrateToOtherZoneResponse
 */
async function migrateToOtherZoneWithOptions(request: MigrateToOtherZoneRequest, runtime: $RuntimeOptions): MigrateToOtherZoneResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.readOnlyCount)) {
    query['ReadOnlyCount'] = request.readOnlyCount;
  }
  if (!$isNull(request.replicaCount)) {
    query['ReplicaCount'] = request.replicaCount;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.slaveReadOnlyCount)) {
    query['SlaveReadOnlyCount'] = request.slaveReadOnlyCount;
  }
  if (!$isNull(request.slaveReplicaCount)) {
    query['SlaveReplicaCount'] = request.slaveReplicaCount;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MigrateToOtherZone',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Migrates a Tair (Redis OSS-compatible) instance to another zone in the same region.
 *
 * @description Before you call this operation, you must release the public endpoint (if any) of the instance. For more information, see [Migrate an instance across zones](https://help.aliyun.com/document_detail/106272.html).
 * > 
 * *   If the network type of an Tair (Redis OSS-compatible) instance is switched from classic network to Virtual Private Cloud (VPC), and the classic network endpoint is retained, you can migrate the instance across zones only after the classic network endpoint is released upon expiration.
 * *   After the instance is migrated, the endpoint of the instance remains unchanged. However, the virtual IP address (VIP) is changed. We recommend that you use the endpoint instead of the VIP to connect to the instance.
 *
 * @param request MigrateToOtherZoneRequest
 * @return MigrateToOtherZoneResponse
 */
async function migrateToOtherZone(request: MigrateToOtherZoneRequest): MigrateToOtherZoneResponse {
  var runtime = new $RuntimeOptions{};
  return migrateToOtherZoneWithOptions(request, runtime);
}

model ModifyAccountDescriptionRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the account.

*   The description must start with a letter and cannot start with `http://` or `https://`.
*   The description can contain letters, digits, underscores (_), and hyphens (-).
*   The description must be 2 to 256 characters in length.

This parameter is required.', example='testescription'),
  accountName?: string(name='AccountName', description='The username of the account. You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/473816.html) operation to query the username of the account.

This parameter is required.', example='demoaccount'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='This parameter is automatically generated by the service, You do not need to specify this parameter.', example='SDK'),
}

model ModifyAccountDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B****'),
}

model ModifyAccountDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountDescriptionResponseBody(name='body'),
}

/**
 * @summary Modifies the description of an account for a Tair (Redis OSS-compatible) instance.
 *
 * @description This operation is supported only for instances that run Redis 4.0 or later.
 *
 * @param request ModifyAccountDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescriptionWithOptions(request: ModifyAccountDescriptionRequest, runtime: $RuntimeOptions): ModifyAccountDescriptionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAccountDescription',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the description of an account for a Tair (Redis OSS-compatible) instance.
 *
 * @description This operation is supported only for instances that run Redis 4.0 or later.
 *
 * @param request ModifyAccountDescriptionRequest
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescription(request: ModifyAccountDescriptionRequest): ModifyAccountDescriptionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAccountDescriptionWithOptions(request, runtime);
}

model ModifyAccountPasswordRequest {
  accountName?: string(name='AccountName', description='The username of the account for which you want to change the password. You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/473816.html) operation to query the username of the account.

This parameter is required.', example='testaccount'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  newAccountPassword?: string(name='NewAccountPassword', description='The new password to be set for the account. The password must be 8 to 32 characters in length and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters. These special characters include `! @ # $ % ^ & * ( ) _ + - =`

This parameter is required.', example='newPassWd888****'),
  oldAccountPassword?: string(name='OldAccountPassword', description='The current password of the account.
 
> If you forget your password, you can call the [ResetAccountPassword](https://help.aliyun.com/document_detail/473815.html) operation to reset your password.

This parameter is required.', example='oldPassWd999****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
}

model ModifyAccountPasswordResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model ModifyAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountPasswordResponseBody(name='body'),
}

/**
 * @summary Changes the password of a specific account for a Tair (Redis OSS-compatible) instance.
 *
 * @param request ModifyAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountPasswordResponse
 */
async function modifyAccountPasswordWithOptions(request: ModifyAccountPasswordRequest, runtime: $RuntimeOptions): ModifyAccountPasswordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.newAccountPassword)) {
    query['NewAccountPassword'] = request.newAccountPassword;
  }
  if (!$isNull(request.oldAccountPassword)) {
    query['OldAccountPassword'] = request.oldAccountPassword;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAccountPassword',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the password of a specific account for a Tair (Redis OSS-compatible) instance.
 *
 * @param request ModifyAccountPasswordRequest
 * @return ModifyAccountPasswordResponse
 */
async function modifyAccountPassword(request: ModifyAccountPasswordRequest): ModifyAccountPasswordResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAccountPasswordWithOptions(request, runtime);
}

model ModifyActiveOperationTaskRequest {
  ids?: string(name='Ids', description='The ID of the O\\\\&M task. Separate multiple IDs with commas (,).

> You can call the [DescribeActiveOperationTask](https://help.aliyun.com/document_detail/473865.html) operation to query the ID of an O\\\\&M task.

This parameter is required.', example='11111,22222'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  switchTime?: string(name='SwitchTime', description='The scheduled switchover time to be specified. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

> The time cannot be later than the latest operation time. You can call the [DescribeActiveOperationTask](https://help.aliyun.com/document_detail/473865.html) operation to obtain the latest operation time, which is the value of the **Deadline** parameter in the response.

This parameter is required.', example='2019-10-17T18:50:00Z'),
}

model ModifyActiveOperationTaskResponseBody = {
  ids?: string(name='Ids', description='The ID of the O\\\\&M task. IDs are separated by commas (,).', example='11111,22222'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model ModifyActiveOperationTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyActiveOperationTaskResponseBody(name='body'),
}

/**
 * @summary Changes the scheduled switchover time of an O&M task.
 *
 * @description You can receive notifications for Tair (Redis OSS-compatible) events such as instance migration and version upgrade by text message, phone call, email, internal message, or by using the console. You can also change the scheduled switchover time of a task by using the console. For more information, see [Query or manage pending events](https://help.aliyun.com/document_detail/187022.html).
 *
 * @param request ModifyActiveOperationTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyActiveOperationTaskResponse
 */
async function modifyActiveOperationTaskWithOptions(request: ModifyActiveOperationTaskRequest, runtime: $RuntimeOptions): ModifyActiveOperationTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyActiveOperationTask',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the scheduled switchover time of an O&M task.
 *
 * @description You can receive notifications for Tair (Redis OSS-compatible) events such as instance migration and version upgrade by text message, phone call, email, internal message, or by using the console. You can also change the scheduled switchover time of a task by using the console. For more information, see [Query or manage pending events](https://help.aliyun.com/document_detail/187022.html).
 *
 * @param request ModifyActiveOperationTaskRequest
 * @return ModifyActiveOperationTaskResponse
 */
async function modifyActiveOperationTask(request: ModifyActiveOperationTaskRequest): ModifyActiveOperationTaskResponse {
  var runtime = new $RuntimeOptions{};
  return modifyActiveOperationTaskWithOptions(request, runtime);
}

model ModifyActiveOperationTasksRequest {
  ids?: string(name='Ids', description='The IDs of the O\\\\&M events. Separate multiple event IDs with commas (,).

This parameter is required.', example='1111721,1111718'),
  immediateStart?: int32(name='ImmediateStart', description='Specifies whether to immediately start scheduling. Valid values:

*   0 (default): Scheduling is not started immediately.
*   1: Scheduling is started immediately.

>  If you set this parameter to 0, the SwitchTime parameter takes effect. If you set this parameter to 1, the SwitchTime parameter does not take effect. In this case, the start time of the event is set to the current time, and the system determines the switching time based on the start time. Scheduling is started immediately, which is a prerequisite for the switchover. Then, the switchover is performed. You can call the DescribeActiveOperationTasks operation to query the preparation time that is returned for the PrepareInterval parameter.', example='0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  switchTime?: string(name='SwitchTime', description='The scheduled switching time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The time that is specified by the SwitchTime parameter cannot be later than the time that is specified by the Deadline parameter. You can call the DescribeActiveOperationTasks operation to query the latest switching time that is returned for the Deadline parameter.

This parameter is required.', example='2019-10-17T18:50:00Z'),
}

model ModifyActiveOperationTasksResponseBody = {
  ids?: string(name='Ids', description='The IDs of the O\\\\&M events. Separate multiple event IDs with commas (,).', example='11111,22222'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E278D833-BB4B-50BF-8646-7BC1BAB2373B'),
}

model ModifyActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Modifies the switching time of scheduled O\\\\\\&M events for an instance.
 *
 * @param request ModifyActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasksWithOptions(request: ModifyActiveOperationTasksRequest, runtime: $RuntimeOptions): ModifyActiveOperationTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!$isNull(request.immediateStart)) {
    query['ImmediateStart'] = request.immediateStart;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyActiveOperationTasks',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the switching time of scheduled O\\\\\\&M events for an instance.
 *
 * @param request ModifyActiveOperationTasksRequest
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasks(request: ModifyActiveOperationTasksRequest): ModifyActiveOperationTasksResponse {
  var runtime = new $RuntimeOptions{};
  return modifyActiveOperationTasksWithOptions(request, runtime);
}

model ModifyAuditLogConfigRequest {
  dbAudit?: boolean(name='DbAudit', description='Specifies whether to enable the audit log feature. Default value: true. Valid values:

*   **true**: enables the audit log feature.
*   **false**: disables the audit log feature.

> If the instance uses the [cluster architecture](https://help.aliyun.com/document_detail/52228.html) or [read/write splitting architecture](https://help.aliyun.com/document_detail/62870.html), the audit log feature is enabled or disabled for both the data nodes and proxy nodes. You cannot separately enable the audit log feature for the data nodes or proxy nodes.', example='true'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  retention?: int32(name='Retention', description='The retention period of audit logs. Valid values: **1** to **365**. Unit: days.

> 

*   This parameter is required only when the **DbAudit** parameter is set to **true**.

*   The value of this parameter takes effect for all instances in the current region.', example='10'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyAuditLogConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B****'),
}

model ModifyAuditLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAuditLogConfigResponseBody(name='body'),
}

/**
 * @summary Enables the audit log feature or modifies the audit log settings for a Tair (Redis OSS-compatible) instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of the audit log feature.
 * Before you call this operation, make sure that the Tair (Redis OSS-compatible) instance meets the following requirements:
 * *   The instance is a Tair (Redis OSS-compatible) Community Edition instance or Tair [DRAM-based instance](https://help.aliyun.com/document_detail/126164.html).
 * *   The engine version of the instance is Redis 4.0 or later, and the latest minor version is used. You can call the [DescribeEngineVersion](https://help.aliyun.com/document_detail/473781.html) operation to check whether the instance uses the latest major version and minor version.
 *
 * @param request ModifyAuditLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAuditLogConfigResponse
 */
async function modifyAuditLogConfigWithOptions(request: ModifyAuditLogConfigRequest, runtime: $RuntimeOptions): ModifyAuditLogConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbAudit)) {
    query['DbAudit'] = request.dbAudit;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.retention)) {
    query['Retention'] = request.retention;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAuditLogConfig',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables the audit log feature or modifies the audit log settings for a Tair (Redis OSS-compatible) instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://help.aliyun.com/document_detail/54532.html) of the audit log feature.
 * Before you call this operation, make sure that the Tair (Redis OSS-compatible) instance meets the following requirements:
 * *   The instance is a Tair (Redis OSS-compatible) Community Edition instance or Tair [DRAM-based instance](https://help.aliyun.com/document_detail/126164.html).
 * *   The engine version of the instance is Redis 4.0 or later, and the latest minor version is used. You can call the [DescribeEngineVersion](https://help.aliyun.com/document_detail/473781.html) operation to check whether the instance uses the latest major version and minor version.
 *
 * @param request ModifyAuditLogConfigRequest
 * @return ModifyAuditLogConfigResponse
 */
async function modifyAuditLogConfig(request: ModifyAuditLogConfigRequest): ModifyAuditLogConfigResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAuditLogConfigWithOptions(request, runtime);
}

model ModifyBackupPolicyRequest {
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod', description='The number of days for which you want to retain data backup files. Valid values: 7 to 730. Default value: 7.', example='7'),
  enableBackupLog?: int32(name='EnableBackupLog', description='Enables or disables the data flashback feature for the instance. Valid values:

*   **1**: enables the data flashback feature. You must also enable AOF persistence by setting `appendonly` to `yes` in the parameter settings of the instance. Then, you can use the data flashback feature.
*   **0** (default): disables the data flashback feature.

>  This parameter is available only for ApsaraDB for Redis Enhanced Edition (Tair) DRAM-based and persistent memory-optimized instances. For more information, see [Data flashback](https://help.aliyun.com/document_detail/443784.html).', example='1'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The days of the week to back up data. Valid values:

*   **Monday**
*   **Tuesday**
*   **Wednesday**
*   **Thursday**
*   **Friday**
*   **Saturday**
*   **Sunday**

> Separate multiple options with commas (,).

This parameter is required.', example='Tuesday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The time range to back up data. Specify the time in the *HH:mm*Z-*HH:mm*Z format. The time is displayed in UTC.

> The beginning and end of the time range must be on the hour. The duration must be an hour.

This parameter is required.', example='07:00Z-08:00Z'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyBackupPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B****'),
}

model ModifyBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyBackupPolicyResponseBody(name='body'),
}

/**
 * @summary Modifies the automatic backup policy of an ApsaraDB for Redis instance.
 *
 * @param request ModifyBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicyWithOptions(request: ModifyBackupPolicyRequest, runtime: $RuntimeOptions): ModifyBackupPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupRetentionPeriod)) {
    query['BackupRetentionPeriod'] = request.backupRetentionPeriod;
  }
  if (!$isNull(request.enableBackupLog)) {
    query['EnableBackupLog'] = request.enableBackupLog;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.preferredBackupPeriod)) {
    query['PreferredBackupPeriod'] = request.preferredBackupPeriod;
  }
  if (!$isNull(request.preferredBackupTime)) {
    query['PreferredBackupTime'] = request.preferredBackupTime;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyBackupPolicy',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the automatic backup policy of an ApsaraDB for Redis instance.
 *
 * @param request ModifyBackupPolicyRequest
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicy(request: ModifyBackupPolicyRequest): ModifyBackupPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return modifyBackupPolicyWithOptions(request, runtime);
}

model ModifyDBInstanceAutoUpgradeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID. You can call the DescribeDBInstances operation to obtain the ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  value?: string(name='Value', description='Specifies whether to enable automatic minor version update. Valid values:

*   **1**: enables automatic minor version update.
*   **0**: disables automatic minor version update.

This parameter is required.', example='0'),
}

model ModifyDBInstanceAutoUpgradeResponseBody = {
  requestId?: string(name='RequestId', description='ID of the request.', example='2FF6158E-3394-4A90-B634-79C49184****'),
}

model ModifyDBInstanceAutoUpgradeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceAutoUpgradeResponseBody(name='body'),
}

/**
 * @summary Modifies the setting related to the automatic update of minor versions for an instance.
 *
 * @param request ModifyDBInstanceAutoUpgradeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceAutoUpgradeResponse
 */
async function modifyDBInstanceAutoUpgradeWithOptions(request: ModifyDBInstanceAutoUpgradeRequest, runtime: $RuntimeOptions): ModifyDBInstanceAutoUpgradeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDBInstanceAutoUpgrade',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the setting related to the automatic update of minor versions for an instance.
 *
 * @param request ModifyDBInstanceAutoUpgradeRequest
 * @return ModifyDBInstanceAutoUpgradeResponse
 */
async function modifyDBInstanceAutoUpgrade(request: ModifyDBInstanceAutoUpgradeRequest): ModifyDBInstanceAutoUpgradeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDBInstanceAutoUpgradeWithOptions(request, runtime);
}

model ModifyDBInstanceConnectionStringRequest {
  currentConnectionString?: string(name='CurrentConnectionString', description='The current endpoint of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  IPType?: string(name='IPType', description='The network type of the endpoint. Valid values:

*   **Private**: internal network
*   **Public**: Internet', example='Public'),
  newConnectionString?: string(name='NewConnectionString', description='The prefix of the new endpoint. Specify the endpoint in the `<prefix>.redis.rds.aliyuncs.com` format. The prefix must be 8 to 40 characters in length and can contain lowercase letters and digits. It must start with a lowercase letter.

>  You must specify one of the **NewConnectionString** and **Port** parameters.', example='standardredis'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  port?: string(name='Port', description='The port number of the instance. Valid values: **1024** to **65535**.

>  You must specify one of the **NewConnectionString** and **Port** parameters.', example='6379'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyDBInstanceConnectionStringResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1790D68A-465C-44E3-BC24-9732652961F9'),
}

model ModifyDBInstanceConnectionStringResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceConnectionStringResponseBody(name='body'),
}

/**
 * @summary Changes the endpoint or port number of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also modify the endpoint or port number of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Change the endpoint or port number of an instance](https://help.aliyun.com/document_detail/85683.html).
 *
 * @param request ModifyDBInstanceConnectionStringRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceConnectionStringResponse
 */
async function modifyDBInstanceConnectionStringWithOptions(request: ModifyDBInstanceConnectionStringRequest, runtime: $RuntimeOptions): ModifyDBInstanceConnectionStringResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentConnectionString)) {
    query['CurrentConnectionString'] = request.currentConnectionString;
  }
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.IPType)) {
    query['IPType'] = request.IPType;
  }
  if (!$isNull(request.newConnectionString)) {
    query['NewConnectionString'] = request.newConnectionString;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.port)) {
    query['Port'] = request.port;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDBInstanceConnectionString',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the endpoint or port number of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also modify the endpoint or port number of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Change the endpoint or port number of an instance](https://help.aliyun.com/document_detail/85683.html).
 *
 * @param request ModifyDBInstanceConnectionStringRequest
 * @return ModifyDBInstanceConnectionStringResponse
 */
async function modifyDBInstanceConnectionString(request: ModifyDBInstanceConnectionStringRequest): ModifyDBInstanceConnectionStringResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDBInstanceConnectionStringWithOptions(request, runtime);
}

model ModifyGlobalSecurityIPGroupRequest {
  GIpList?: string(name='GIpList', description='The IP addresses in the IP whitelist template.

This parameter is required.', example='192.168.0.1,10.10.10.10,172.16.0.1'),
  globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template. The name must meet the following requirements:

*   The name can contain lowercase letters, digits, and underscores (_).
*   The name must start with a letter and end with a letter or a digit.
*   The name must be 2 to 120 characters in length.

This parameter is required.', example='test_123'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-zsldxfiwjmti0kcm****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyGlobalSecurityIPGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='686BB8A6-BBA5-47E5-8A75-D2ADE433****'),
}

model ModifyGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Modifies a global IP whitelist template.
 *
 * @param request ModifyGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyGlobalSecurityIPGroupResponse
 */
async function modifyGlobalSecurityIPGroupWithOptions(request: ModifyGlobalSecurityIPGroupRequest, runtime: $RuntimeOptions): ModifyGlobalSecurityIPGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.GIpList)) {
    query['GIpList'] = request.GIpList;
  }
  if (!$isNull(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!$isNull(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyGlobalSecurityIPGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies a global IP whitelist template.
 *
 * @param request ModifyGlobalSecurityIPGroupRequest
 * @return ModifyGlobalSecurityIPGroupResponse
 */
async function modifyGlobalSecurityIPGroup(request: ModifyGlobalSecurityIPGroupRequest): ModifyGlobalSecurityIPGroupResponse {
  var runtime = new $RuntimeOptions{};
  return modifyGlobalSecurityIPGroupWithOptions(request, runtime);
}

model ModifyGlobalSecurityIPGroupNameRequest {
  globalIgName?: string(name='GlobalIgName', description='The name of the global IP whitelist template. The name must meet the following requirements:

*   The name can contain lowercase letters, digits, and underscores (_).
*   The name must start with a letter and end with a letter or a digit.
*   The name must be 2 to 120 characters in length.

This parameter is required.', example='test_123'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-kd2iop4aur9qwxnvh***'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyGlobalSecurityIPGroupNameResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2B17D708-1D6D-49F3-B6D7-478371DD****'),
}

model ModifyGlobalSecurityIPGroupNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGlobalSecurityIPGroupNameResponseBody(name='body'),
}

/**
 * @summary Modifies the name of a global IP whitelist template.
 *
 * @param request ModifyGlobalSecurityIPGroupNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyGlobalSecurityIPGroupNameResponse
 */
async function modifyGlobalSecurityIPGroupNameWithOptions(request: ModifyGlobalSecurityIPGroupNameRequest, runtime: $RuntimeOptions): ModifyGlobalSecurityIPGroupNameResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!$isNull(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyGlobalSecurityIPGroupName',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the name of a global IP whitelist template.
 *
 * @param request ModifyGlobalSecurityIPGroupNameRequest
 * @return ModifyGlobalSecurityIPGroupNameResponse
 */
async function modifyGlobalSecurityIPGroupName(request: ModifyGlobalSecurityIPGroupNameRequest): ModifyGlobalSecurityIPGroupNameResponse {
  var runtime = new $RuntimeOptions{};
  return modifyGlobalSecurityIPGroupNameWithOptions(request, runtime);
}

model ModifyGlobalSecurityIPGroupRelationRequest {
  DBClusterId?: string(name='DBClusterId', description='The instance ID.

This parameter is required.', example='r-t4n885e834f6****'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-zsldxfiwjmti0kcm****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyGlobalSecurityIPGroupRelationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1E83311F-0EE4-4922-A3BF-730B312B****'),
}

model ModifyGlobalSecurityIPGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGlobalSecurityIPGroupRelationResponseBody(name='body'),
}

/**
 * @summary Adds a specified instance to a specified IP whitelist template.
 *
 * @param request ModifyGlobalSecurityIPGroupRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyGlobalSecurityIPGroupRelationResponse
 */
async function modifyGlobalSecurityIPGroupRelationWithOptions(request: ModifyGlobalSecurityIPGroupRelationRequest, runtime: $RuntimeOptions): ModifyGlobalSecurityIPGroupRelationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!$isNull(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyGlobalSecurityIPGroupRelation',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds a specified instance to a specified IP whitelist template.
 *
 * @param request ModifyGlobalSecurityIPGroupRelationRequest
 * @return ModifyGlobalSecurityIPGroupRelationResponse
 */
async function modifyGlobalSecurityIPGroupRelation(request: ModifyGlobalSecurityIPGroupRelationRequest): ModifyGlobalSecurityIPGroupRelationResponse {
  var runtime = new $RuntimeOptions{};
  return modifyGlobalSecurityIPGroupRelationWithOptions(request, runtime);
}

model ModifyInstanceAttributeRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  instanceName?: string(name='InstanceName', description='The new name of the instance. The name must be 2 to 80 characters in length. The name must start with a letter and cannot contain spaces and the following special characters: `@ / : = " < > { [ ] }`', example='newinstancename'),
  instanceReleaseProtection?: boolean(name='InstanceReleaseProtection', description='[Specifies whether to enable release protection for the instance.](https://help.aliyun.com/document_detail/165005.html) Valid values:

*   **true**: enables release protection.
*   **false**: disables release protection.

>  This parameter is available only for pay-as-you-go instances.', example='true'),
  newPassword?: string(name='NewPassword', description='The new password for the default account. The default account is named after the instance ID. Example: r-bp10noxlhcoim2\\\\*\\\\*\\\\*\\\\*.

> The password must be 8 to 32 characters in length and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. These special characters include `! @ # $ % ^ & * ( ) _ + - =`', example='uW8+nsrp'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B3E76'),
}

model ModifyInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the specific information of a Tair (Redis OSS-compatible) instance, such as the password and the name.
 *
 * @description You can also modify the information of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Change or reset the password](https://help.aliyun.com/document_detail/43874.html).
 *
 * @param request ModifyInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceAttributeResponse
 */
async function modifyInstanceAttributeWithOptions(request: ModifyInstanceAttributeRequest, runtime: $RuntimeOptions): ModifyInstanceAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.instanceReleaseProtection)) {
    query['InstanceReleaseProtection'] = request.instanceReleaseProtection;
  }
  if (!$isNull(request.newPassword)) {
    query['NewPassword'] = request.newPassword;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the specific information of a Tair (Redis OSS-compatible) instance, such as the password and the name.
 *
 * @description You can also modify the information of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Change or reset the password](https://help.aliyun.com/document_detail/43874.html).
 *
 * @param request ModifyInstanceAttributeRequest
 * @return ModifyInstanceAttributeResponse
 */
async function modifyInstanceAttribute(request: ModifyInstanceAttributeRequest): ModifyInstanceAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceAttributeWithOptions(request, runtime);
}

model ModifyInstanceAutoRenewalAttributeRequest {
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal. Valid values:

*   **true**
*   **false**

>  The default value is **false**.', example='true'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance. Separate multiple instance IDs with commas (,).

> You can specify up to 30 instance IDs.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  duration?: string(name='Duration', description='The auto-renewal period. Valid values: **1** to **12**. Unit: months. When the instance is about to expire, the instance is automatically renewed based on the number of months specified by this parameter.

> This parameter is available and required only if the **AutoRenew** parameter is set to **true**.', example='3'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  product?: string(name='Product', description='The service. Set the value to kvstore.', example='kvstore'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceAutoRenewalAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='52D901ED-E0A5-42FB-B9DB-39C295C3****'),
}

model ModifyInstanceAutoRenewalAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceAutoRenewalAttributeResponseBody(name='body'),
}

/**
 * @summary Enables or disables auto-renewal for an ApsaraDB for Redis instance.
 *
 * @description > Auto-renewal is triggered seven days before the expiration date of the instance.
 *
 * @param request ModifyInstanceAutoRenewalAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceAutoRenewalAttributeResponse
 */
async function modifyInstanceAutoRenewalAttributeWithOptions(request: ModifyInstanceAutoRenewalAttributeRequest, runtime: $RuntimeOptions): ModifyInstanceAutoRenewalAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.product)) {
    query['Product'] = request.product;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceAutoRenewalAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables auto-renewal for an ApsaraDB for Redis instance.
 *
 * @description > Auto-renewal is triggered seven days before the expiration date of the instance.
 *
 * @param request ModifyInstanceAutoRenewalAttributeRequest
 * @return ModifyInstanceAutoRenewalAttributeResponse
 */
async function modifyInstanceAutoRenewalAttribute(request: ModifyInstanceAutoRenewalAttributeRequest): ModifyInstanceAutoRenewalAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceAutoRenewalAttributeWithOptions(request, runtime);
}

model ModifyInstanceBandwidthRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  targetIntranetBandwidth?: string(name='TargetIntranetBandwidth', description='The total expected bandwidth of the instance.

> If the instance is a cluster instance, the TargetIntranetBandwidth must be divisible by the number of shards in the instance. This operation is not supported for read/write splitting instances.

This parameter is required.', example='260'),
}

model ModifyInstanceBandwidthResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='236934422960904'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model ModifyInstanceBandwidthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceBandwidthResponseBody(name='body'),
}

/**
 * @summary Sets the intended bandwidth value of a Tair (Redis OSS-compatible) instance.
 *
 * @description *   Before you call this operation, make sure that you understand the billing methods and pricing of instance bandwidth. Tair (Redis OSS-compatible) charges fees per hour based on the amount and usage duration of the extra bandwidth that you purchase. The fees vary based on the region that you select. For more information, see [Billable items](https://help.aliyun.com/document_detail/54532.html).
 * *   The bandwidth of an instance or a shard can be increased by up to six times the default bandwidth of the instance, but the increase in bandwidth cannot exceed 192 Mbit/s. For example, if the default bandwidth of a Tair DRAM-based master-replica instance equipped with 2 GB of memory is 96 Mbit/s, you can increase the bandwidth of the instance by up to 192 Mbit/s. As a result, the maximum bandwidth of the instance is 288 Mbit/s. If the default bandwidth of a Redis Open-Source Edition master-replica instance equipped with 256 MB of memory is 10 Mbit/s, you can increase the bandwidth of the instance by up to 60 Mbit/s. As a result, the maximum bandwidth of the instance is 70 Mbit/s.
 *
 * @param request ModifyInstanceBandwidthRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceBandwidthResponse
 */
async function modifyInstanceBandwidthWithOptions(request: ModifyInstanceBandwidthRequest, runtime: $RuntimeOptions): ModifyInstanceBandwidthResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.targetIntranetBandwidth)) {
    query['TargetIntranetBandwidth'] = request.targetIntranetBandwidth;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceBandwidth',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Sets the intended bandwidth value of a Tair (Redis OSS-compatible) instance.
 *
 * @description *   Before you call this operation, make sure that you understand the billing methods and pricing of instance bandwidth. Tair (Redis OSS-compatible) charges fees per hour based on the amount and usage duration of the extra bandwidth that you purchase. The fees vary based on the region that you select. For more information, see [Billable items](https://help.aliyun.com/document_detail/54532.html).
 * *   The bandwidth of an instance or a shard can be increased by up to six times the default bandwidth of the instance, but the increase in bandwidth cannot exceed 192 Mbit/s. For example, if the default bandwidth of a Tair DRAM-based master-replica instance equipped with 2 GB of memory is 96 Mbit/s, you can increase the bandwidth of the instance by up to 192 Mbit/s. As a result, the maximum bandwidth of the instance is 288 Mbit/s. If the default bandwidth of a Redis Open-Source Edition master-replica instance equipped with 256 MB of memory is 10 Mbit/s, you can increase the bandwidth of the instance by up to 60 Mbit/s. As a result, the maximum bandwidth of the instance is 70 Mbit/s.
 *
 * @param request ModifyInstanceBandwidthRequest
 * @return ModifyInstanceBandwidthResponse
 */
async function modifyInstanceBandwidth(request: ModifyInstanceBandwidthRequest): ModifyInstanceBandwidthResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceBandwidthWithOptions(request, runtime);
}

model ModifyInstanceConfigRequest {
  config?: string(name='Config', description='The instance parameter settings that you want to modify. Specify this parameter in the JSON format. The new value of a parameter overwrites the original value.

**

**Description** For more information, see [Supported parameters](https://help.aliyun.com/document_detail/259681.html).', example='{"maxmemory-policy":"volatile-lru","zset-max-ziplist-entries":128,"zset-max-ziplist-value":64,"hash-max-ziplist-entries":512,"set-max-intset-entries":512}'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  paramNoLooseSentinelEnabled?: string(name='ParamNoLooseSentinelEnabled', description='The Sentinel-compatible mode, which is applicable to non-cluster instances. For more information about the parameter, see the relevant documentation.', example='yes'),
  paramNoLooseSentinelPasswordFreeAccess?: string(name='ParamNoLooseSentinelPasswordFreeAccess', description='Specifies whether to allow Sentinel commands to be run without requiring a password when the Sentinel mode is enabled. Valid values: Valid values: yes and no. Default value: no. After you set this parameter to yes, you can run Sentinel commands in a virtual private cloud (VPC) without the need to enable the password-free access feature.', example='****'),
  paramNoLooseSentinelPasswordFreeCommands?: string(name='ParamNoLooseSentinelPasswordFreeCommands', description='After you enable the Sentinel mode and set the ParamNoLooseSentinelPasswordFreeAccess parameter to yes, you can use this parameter to specify an additional list of commands that can be run without requiring a password. By default, this parameter is empty. After you configure this parameter, you can run the specified commands without a password on any connection. Proceed with caution. The commands must be written in lowercase letters. Separate multiple commands with commas (,).', example='****'),
  paramReplMode?: string(name='ParamReplMode', description='The synchronization mode.

*   **semisync**
*   **async**', example='async'),
  paramSemisyncReplTimeout?: string(name='ParamSemisyncReplTimeout', description='The degradation threshold time of the semi-synchronous replication mode. This parameter is required only when semi-synchronous replication is enabled. Unit: milliseconds. Valid values: 10 to 60000.', example='****'),
  paramSentinelCompatEnable?: string(name='ParamSentinelCompatEnable', description='The Sentinel-compatible mode, which is applicable to cluster instances in proxy mode or read/write splitting instances. For more information about the parameter, see the relevant documentation.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B****'),
}

model ModifyInstanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceConfigResponseBody(name='body'),
}

/**
 * @summary Modifies the parameter settings of an ApsaraDB for Redis instance.
 *
 * @param request ModifyInstanceConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceConfigResponse
 */
async function modifyInstanceConfigWithOptions(request: ModifyInstanceConfigRequest, runtime: $RuntimeOptions): ModifyInstanceConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.config)) {
    query['Config'] = request.config;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.paramNoLooseSentinelEnabled)) {
    query['ParamNoLooseSentinelEnabled'] = request.paramNoLooseSentinelEnabled;
  }
  if (!$isNull(request.paramNoLooseSentinelPasswordFreeAccess)) {
    query['ParamNoLooseSentinelPasswordFreeAccess'] = request.paramNoLooseSentinelPasswordFreeAccess;
  }
  if (!$isNull(request.paramNoLooseSentinelPasswordFreeCommands)) {
    query['ParamNoLooseSentinelPasswordFreeCommands'] = request.paramNoLooseSentinelPasswordFreeCommands;
  }
  if (!$isNull(request.paramReplMode)) {
    query['ParamReplMode'] = request.paramReplMode;
  }
  if (!$isNull(request.paramSemisyncReplTimeout)) {
    query['ParamSemisyncReplTimeout'] = request.paramSemisyncReplTimeout;
  }
  if (!$isNull(request.paramSentinelCompatEnable)) {
    query['ParamSentinelCompatEnable'] = request.paramSentinelCompatEnable;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceConfig',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the parameter settings of an ApsaraDB for Redis instance.
 *
 * @param request ModifyInstanceConfigRequest
 * @return ModifyInstanceConfigResponse
 */
async function modifyInstanceConfig(request: ModifyInstanceConfigRequest): ModifyInstanceConfigResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceConfigWithOptions(request, runtime);
}

model ModifyInstanceMaintainTimeRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window. The time is in the *HH:mm*Z format. The time is displayed in UTC. For example, if you want the maintenance window to end at 2:00 (UTC+8), set this parameter to `18:00Z`.

>  The interval between the start time and the end time cannot be less than 1 hour.

This parameter is required.', example='04:00Z'),
  maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window. The time is in the *HH:mm*Z format. The time is displayed in UTC. For example, if you want the maintenance to start at 1:00 (UTC+8), set this parameter to `17:00Z`. After you call the API operation, you can view the actual time in the Tair (Redis OSS-compatible) console. For more information, see [Set a maintenance window](https://help.aliyun.com/document_detail/55252.html).

This parameter is required.', example='03:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceMaintainTimeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B3E76'),
}

model ModifyInstanceMaintainTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceMaintainTimeResponseBody(name='body'),
}

/**
 * @summary Modifies the maintenance window of an Tair (Redis OSS-compatible) instance. Alibaba Cloud maintains Tair (Redis OSS-compatible) instances during the specified maintenance window.
 *
 * @description You can also modify the maintenance window of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Set a maintenance window](https://help.aliyun.com/document_detail/55252.html).
 *
 * @param request ModifyInstanceMaintainTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceMaintainTimeResponse
 */
async function modifyInstanceMaintainTimeWithOptions(request: ModifyInstanceMaintainTimeRequest, runtime: $RuntimeOptions): ModifyInstanceMaintainTimeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.maintainEndTime)) {
    query['MaintainEndTime'] = request.maintainEndTime;
  }
  if (!$isNull(request.maintainStartTime)) {
    query['MaintainStartTime'] = request.maintainStartTime;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceMaintainTime',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the maintenance window of an Tair (Redis OSS-compatible) instance. Alibaba Cloud maintains Tair (Redis OSS-compatible) instances during the specified maintenance window.
 *
 * @description You can also modify the maintenance window of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Set a maintenance window](https://help.aliyun.com/document_detail/55252.html).
 *
 * @param request ModifyInstanceMaintainTimeRequest
 * @return ModifyInstanceMaintainTimeResponse
 */
async function modifyInstanceMaintainTime(request: ModifyInstanceMaintainTimeRequest): ModifyInstanceMaintainTimeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceMaintainTimeWithOptions(request, runtime);
}

model ModifyInstanceMajorVersionRequest {
  effectiveTime?: string(name='EffectiveTime', description='The time when you want to upgrade the major version. Valid values:

*   **Immediately** (default): immediately upgrades the major version.
*   **MaintainTime**: upgrades the major version within the maintenance window.

>  You can call the [ModifyInstanceMaintainTime](https://help.aliyun.com/document_detail/473775.html) operation to modify the maintenance window of an instance.', example='Immediately'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  majorVersion?: string(name='MajorVersion', description='The major version to which you want to upgrade the instance. Valid values: **4.0** and **5.0**.

This parameter is required.', example='5.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceMajorVersionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='AA587FB2-2593-4DFE-BE13-2494C2DF****'),
}

model ModifyInstanceMajorVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceMajorVersionResponseBody(name='body'),
}

/**
 * @summary Upgrades the major version of a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about the precautions and impacts of the upgrade, see [Upgrade the major version](https://help.aliyun.com/document_detail/101764.html).
 *
 * @param request ModifyInstanceMajorVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceMajorVersionResponse
 */
async function modifyInstanceMajorVersionWithOptions(request: ModifyInstanceMajorVersionRequest, runtime: $RuntimeOptions): ModifyInstanceMajorVersionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.majorVersion)) {
    query['MajorVersion'] = request.majorVersion;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceMajorVersion',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Upgrades the major version of a Tair (Redis OSS-compatible) instance.
 *
 * @description For more information about the precautions and impacts of the upgrade, see [Upgrade the major version](https://help.aliyun.com/document_detail/101764.html).
 *
 * @param request ModifyInstanceMajorVersionRequest
 * @return ModifyInstanceMajorVersionResponse
 */
async function modifyInstanceMajorVersion(request: ModifyInstanceMajorVersionRequest): ModifyInstanceMajorVersionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceMajorVersionWithOptions(request, runtime);
}

model ModifyInstanceMinorVersionRequest {
  effectiveTime?: string(name='EffectiveTime', description='The time when you want to update the minor version. Valid values:

*   **Immediately** (default): immediately updates the minor version.
*   **MaintainTime**: updates the minor version during the maintenance window.

>  You can call the [ModifyInstanceMaintainTime](https://help.aliyun.com/document_detail/473775.html) operation to modify the maintenance window of an instance.', example='Immediately'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  minorversion?: string(name='Minorversion', description='The minor version to which you want to update. Default value: **latest_version**.', example='latest_version'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceMinorVersionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='28761557-0B33-41DF-AEEB-322DFF96****'),
}

model ModifyInstanceMinorVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceMinorVersionResponseBody(name='body'),
}

/**
 * @summary Updates the minor version of a Tair (Redis OSS-compatible) instance.
 *
 * @description The procedure to update the minor version of an instance varies based on types of Tair (Redis OSS-compatible) instances. For more information, see [Upgrade the minor version](https://help.aliyun.com/document_detail/56450.html).
 * > 
 * *   Before you call this operation, you can call the [DescribeEngineVersion](https://help.aliyun.com/document_detail/473781.html) operation to query the minor version of the current instance.
 * *   When you switch your workloads over from the original instance to a new instance or from the master node to the replica node in the original instance, you may experience disconnections that last a few seconds. The original instance stays in the read-only state within 60 seconds until all data is synchronized. We recommend that you upgrade the original instance during off-peak hours and make sure that your application is configured to automatically reconnect to the original instance.
 *
 * @param request ModifyInstanceMinorVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceMinorVersionResponse
 */
async function modifyInstanceMinorVersionWithOptions(request: ModifyInstanceMinorVersionRequest, runtime: $RuntimeOptions): ModifyInstanceMinorVersionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.minorversion)) {
    query['Minorversion'] = request.minorversion;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceMinorVersion',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the minor version of a Tair (Redis OSS-compatible) instance.
 *
 * @description The procedure to update the minor version of an instance varies based on types of Tair (Redis OSS-compatible) instances. For more information, see [Upgrade the minor version](https://help.aliyun.com/document_detail/56450.html).
 * > 
 * *   Before you call this operation, you can call the [DescribeEngineVersion](https://help.aliyun.com/document_detail/473781.html) operation to query the minor version of the current instance.
 * *   When you switch your workloads over from the original instance to a new instance or from the master node to the replica node in the original instance, you may experience disconnections that last a few seconds. The original instance stays in the read-only state within 60 seconds until all data is synchronized. We recommend that you upgrade the original instance during off-peak hours and make sure that your application is configured to automatically reconnect to the original instance.
 *
 * @param request ModifyInstanceMinorVersionRequest
 * @return ModifyInstanceMinorVersionResponse
 */
async function modifyInstanceMinorVersion(request: ModifyInstanceMinorVersionRequest): ModifyInstanceMinorVersionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceMinorVersionWithOptions(request, runtime);
}

model ModifyInstanceNetExpireTimeRequest {
  classicExpiredDays?: int32(name='ClassicExpiredDays', description='The extension period to retain the classic network endpoint of the instance. Unit: days. Valid values: **14**, **30**, **60**, and **120**.

This parameter is required.', example='14'),
  connectionString?: string(name='ConnectionString', description='The endpoint of the classic network.

This parameter is required.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceNetExpireTimeResponseBody = {
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
  netInfoItems?: {
    netInfoItem?: [ 
    {
      connectionString?: string(name='ConnectionString', description='The endpoint of the classic network.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
      DBInstanceNetType?: string(name='DBInstanceNetType', description='The network type of the instance. The returned value is **Classic**.', example='Classic'),
      expiredTime?: string(name='ExpiredTime', description='The expiration time of the classic network endpoint.', example='2019-08-01T09:29:18Z'),
      IPAddress?: string(name='IPAddress', description='The IP address of the instance in the classic network.', example='100.118.142.***'),
      port?: string(name='Port', description='The port number that is used to connect to the instance.', example='6379'),
    }
  ](name='NetInfoItem')
  }(name='NetInfoItems', description='Details about the extension period for which the classic network endpoint of the instance is retained.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9C4AF387-1EA3-4C84-8013-3F6B973EDDF5'),
}

model ModifyInstanceNetExpireTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceNetExpireTimeResponseBody(name='body'),
}

/**
 * @summary Extends the retention period of the classic network endpoint of a Tair (Redis OSS-compatible) instance. You can call this operation after you change the network type of the Tair (Redis OSS-compatible) instance from classic network to Virtual Private Cloud (VPC) with the classic network endpoint retained.
 *
 * @description You can also perform this operation in the Tair (Redis OSS-compatible) console. For more information, see [Change the expiration time for the endpoint of the classic network](https://help.aliyun.com/document_detail/60062.html).
 * > For more information about how to switch the network type of a Tair (Redis OSS-compatible) instance from classic network to VPC, see [SwitchNetwork](https://help.aliyun.com/document_detail/473797.html).
 *
 * @param request ModifyInstanceNetExpireTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceNetExpireTimeResponse
 */
async function modifyInstanceNetExpireTimeWithOptions(request: ModifyInstanceNetExpireTimeRequest, runtime: $RuntimeOptions): ModifyInstanceNetExpireTimeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.classicExpiredDays)) {
    query['ClassicExpiredDays'] = request.classicExpiredDays;
  }
  if (!$isNull(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceNetExpireTime',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Extends the retention period of the classic network endpoint of a Tair (Redis OSS-compatible) instance. You can call this operation after you change the network type of the Tair (Redis OSS-compatible) instance from classic network to Virtual Private Cloud (VPC) with the classic network endpoint retained.
 *
 * @description You can also perform this operation in the Tair (Redis OSS-compatible) console. For more information, see [Change the expiration time for the endpoint of the classic network](https://help.aliyun.com/document_detail/60062.html).
 * > For more information about how to switch the network type of a Tair (Redis OSS-compatible) instance from classic network to VPC, see [SwitchNetwork](https://help.aliyun.com/document_detail/473797.html).
 *
 * @param request ModifyInstanceNetExpireTimeRequest
 * @return ModifyInstanceNetExpireTimeResponse
 */
async function modifyInstanceNetExpireTime(request: ModifyInstanceNetExpireTimeRequest): ModifyInstanceNetExpireTimeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceNetExpireTimeWithOptions(request, runtime);
}

model ModifyInstanceParameterRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  parameterGroupId?: string(name='ParameterGroupId', description='The parameter template ID.

> You can view the list of parameter templates in the target region, including the parameter template ID, through the DescribeParameterGroups interface.', example='g-idhwofwofewhf****'),
  parameters?: string(name='Parameters', description='The information about parameters.', example='{"hz": "50"}'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceParameterResponseBody = {
  instanceId?: string(name='InstanceId', description='The instance ID.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='Id of the request', example='561AFBF1-BE20-44DB-9BD1-6988B53E****'),
  taskId?: long(name='TaskId', description='The ID of the task.', example='578678678'),
}

model ModifyInstanceParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceParameterResponseBody(name='body'),
}

/**
 * @summary Applies a parameter template to specific instances. This indicates that the parameter values in the template take effect on the instances. After you modify a parameter template, you must reapply it to specific instances for the new parameter values to take effect on the instances.
 *
 * @param request ModifyInstanceParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceParameterResponse
 */
async function modifyInstanceParameterWithOptions(request: ModifyInstanceParameterRequest, runtime: $RuntimeOptions): ModifyInstanceParameterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.parameterGroupId)) {
    query['ParameterGroupId'] = request.parameterGroupId;
  }
  if (!$isNull(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceParameter',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Applies a parameter template to specific instances. This indicates that the parameter values in the template take effect on the instances. After you modify a parameter template, you must reapply it to specific instances for the new parameter values to take effect on the instances.
 *
 * @param request ModifyInstanceParameterRequest
 * @return ModifyInstanceParameterResponse
 */
async function modifyInstanceParameter(request: ModifyInstanceParameterRequest): ModifyInstanceParameterResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceParameterWithOptions(request, runtime);
}

model ModifyInstanceSSLRequest {
  instanceId?: string(name='InstanceId', description='The instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  SSLEnabled?: string(name='SSLEnabled', description='Specifies whether to enable TLS (SSL) encryption. Valid values:

*   **Disable**: disables SSL encryption.
*   **Enable**: enables SSL encryption.
*   **Update**: updates the SSL certificate.

This parameter is required.', example='Enable'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyInstanceSSLResponseBody = {
  instanceId?: string(name='InstanceId', description='The instance ID.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The request ID.', example='AD7E16AA-6B23-43BF-979C-07D957FB****'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='32184****'),
}

model ModifyInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceSSLResponseBody(name='body'),
}

/**
 * @summary Enables Transport Layer Security (TLS) for a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also configure SSL encryption in the console. For more information, see [Configure SSL encryption](https://help.aliyun.com/document_detail/84898.html).
 * >  To specify the earliest supported SSL version, you can call the [ModifyInstanceConfig](https://help.aliyun.com/document_detail/473844.html) operation to modify the required parameter.
 *
 * @param request ModifyInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceSSLResponse
 */
async function modifyInstanceSSLWithOptions(request: ModifyInstanceSSLRequest, runtime: $RuntimeOptions): ModifyInstanceSSLResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.SSLEnabled)) {
    query['SSLEnabled'] = request.SSLEnabled;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceSSL',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables Transport Layer Security (TLS) for a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also configure SSL encryption in the console. For more information, see [Configure SSL encryption](https://help.aliyun.com/document_detail/84898.html).
 * >  To specify the earliest supported SSL version, you can call the [ModifyInstanceConfig](https://help.aliyun.com/document_detail/473844.html) operation to modify the required parameter.
 *
 * @param request ModifyInstanceSSLRequest
 * @return ModifyInstanceSSLResponse
 */
async function modifyInstanceSSL(request: ModifyInstanceSSLRequest): ModifyInstanceSSLResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceSSLWithOptions(request, runtime);
}

model ModifyInstanceSpecRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true** (default): enables automatic payment.
*   **false**: disables automatic payment. If you set this parameter to **false**, the instance must be manually renewed before it expires. For more information, see [Renew an instance](https://help.aliyun.com/document_detail/26352.html).', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The ID of the promotional event or the business information.', example='000000001'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  effectiveTime?: string(name='EffectiveTime', description='The time when you want the configurations to be changed. Valid values:

*   **Immediately** (default): immediately changes the configurations.
*   **MaintainTime**: changes the configurations within the maintenance window. You can call the [ModifyInstanceMaintainTime](https://help.aliyun.com/document_detail/473775.html) operation to change the maintenance window.', example='Immediately'),
  forceTrans?: boolean(name='ForceTrans', description='Specifies whether to enable forced transmission during a configuration change. Valid values:

*   **false** (default): Before the configuration change, the system checks the minor version of the instance. If the minor version of the instance is outdated, an error is reported. You must update the minor version of the instance and try again.
*   **true**: The system skips the version check and directly performs the configuration change.', example='false'),
  forceUpgrade?: boolean(name='ForceUpgrade', description='Specifies whether to forcibly change the configurations. Valid values:

*   **false**: The system does not forcefully change the configurations.
*   **true** (default): The system forcefully changes the configurations.', example='true'),
  instanceClass?: string(name='InstanceClass', description='The new instance type. You can call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/473765.html) operation to query the instance types available for configuration change within the zone to which the instance belongs.

>  For more information about the instance types, see [Overview](https://help.aliyun.com/document_detail/26350.html).', example='redis.master.small.default'),
  instanceId?: string(name='InstanceId', description='The instance ID. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  majorVersion?: string(name='MajorVersion', description='The major version of the classic instance that you want to upgrade. Valid values: **2.8**, **4.0**, and **5.0**.

>  The **InstanceClass** parameter is required when you upgrade the instance version. This parameter indicates that you can upgrade the instance version only when you update the instance specifications. If you only need to upgrade the instance version, call the [ModifyInstanceMajorVersion](https://help.aliyun.com/document_detail/473776.html) operation.', example='5.0'),
  nodeType?: string(name='NodeType', description='The type of the node. Valid values:

*   **MASTER_SLAVE**: high availability (master-replica)
*   **STAND_ALONE**: standalone
*   **double**: master-replica
*   **single**: standalone

>  To create a cloud-native instance, set this parameter to **MASTER_SLAVE** or **STAND_ALONE**. To create a classic instance, set this parameter to **double** or **single**.', example='MASTER_SLAVE'),
  orderType?: string(name='OrderType', description='The change type. This parameter is required when you change the configurations of a subscription instance. Valid values:

*   **UPGRADE** (default): upgrades the configurations of the subscription instance.
*   **DOWNGRADE**: downgrades the configurations of the subscription instance.

> 

*   To downgrade a subscription instance, you must set this parameter to **DOWNGRADE**.

*   If the price of an instance increases after its configurations are changed, the instance is upgraded. If the price decreases, the instance is downgraded. For example, the price of an 8 GB read/write splitting instance with five read replicas is higher than that of a 16 GB cluster instance. If you want to change a 16 GB cluster instance to an 8 GB read/write splitting instance with five read replicas, you must upgrade the instance.', example='DOWNGRADE'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  readOnlyCount?: int32(name='ReadOnlyCount', description='The number of read replicas in the primary zone. Valid values: 0 to 5. This parameter applies only to the following scenarios:

*   If the instance is a cloud-native standard instance, you can set this parameter to a value greater than 0 to enable the read/write splitting architecture.
*   If the instance is a cloud-native read/write splitting instance, you can use this parameter to customize the number of read replicas. You can also set this parameter to 0 to disable the read/write splitting architecture and switch the instance to the standard architecture.', example='5'),
  regionId?: string(name='RegionId', description='The region ID. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.', example='cn-hangzhou'),
  replicaCount?: int32(name='ReplicaCount', description='The number of replica nodes in the primary zone. This parameter is applicable only to cloud-native multi-replica cluster instances. Valid values: 1 to 4.

> 

*   The sum of the values of this parameter and the SlaveReplicaCount parameter cannot be greater than 4.

*   You can specify either ReplicaCount or ReadOnlyCount.

*   A master-replica instance cannot contain multiple replica nodes.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  shardCount?: int32(name='ShardCount', description='The number of shards. This parameter is applicable only to cloud-native cluster instances.

> 

*   If you want to change a cloud-native cluster instance to a standard instance, you must explicitly set the ShardCount parameter to 1 and specify the specifications of the master-replica instance.

*   To change a cloud-native standard instance to a cluster instance, you must explicitly set the ShardCount parameter to a value greater than 1 and specify the specifications of the cluster instance.', example='8'),
  slaveReadOnlyCount?: int32(name='SlaveReadOnlyCount', description='The number of read replicas in the secondary zone when you create a read/write splitting instance that is deployed across multiple zones. Valid values: 1 to 9. The sum of the values of this parameter and the ReadOnlyCount parameter cannot be greater than 9.', example='2'),
  slaveReplicaCount?: int32(name='SlaveReplicaCount', description='The number of replica nodes in the secondary zone when you create a cloud-native multi-replica cluster instance that is deployed across multiple zones. The sum of the values of this parameter and the ReplicaCount parameter cannot be greater than 4.

>  When you create a cloud-native multi-replica cluster instance that is deployed across multiple zones, you must specify both SlaveReplicaCount and SecondaryZoneId.', example='1'),
  sourceBiz?: string(name='SourceBiz', description='The source of the operation. This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
  storage?: int32(name='Storage', description='The storage capacity of the ESSD/SSD-based instance. The valid values vary based on the instance type. For more information, see [ESSD/SSD-based instances](https://help.aliyun.com/document_detail/2527111.html).

>  This parameter is required only when you set the **InstanceType** parameter to **tair_essd** to create an ESSD-based instance. If you create a Tair **SSD**-based instance, the Storage parameter is automatically specified based on predefined specifications. You do not need to specify this parameter.', example='60'),
  storageType?: string(name='StorageType', description='The storage type. Valid values: **essd_pl1**, **essd_pl2**, and **essd_pl3**.

>  This parameter is required only when you set the **InstanceType** parameter to **tair_essd** to create an ESSD-based instance.', example='essd_pl1'),
}

model ModifyInstanceSpecResponseBody = {
  orderId?: string(name='OrderId', description='The order ID.', example='20722623431****'),
  requestId?: string(name='RequestId', description='The request ID.', example='0DA1D7EF-C80D-432C-8758-7D225182626B'),
}

model ModifyInstanceSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceSpecResponseBody(name='body'),
}

/**
 * @summary Changes the configurations of a Tair (Redis OSS-compatible) instance.
 *
 * @description >  For more information about the procedure, impacts, limits, and fees of this operation, see [Change the configurations of an instance](https://help.aliyun.com/document_detail/26353.html).
 *
 * @param request ModifyInstanceSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceSpecResponse
 */
async function modifyInstanceSpecWithOptions(request: ModifyInstanceSpecRequest, runtime: $RuntimeOptions): ModifyInstanceSpecResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.forceTrans)) {
    query['ForceTrans'] = request.forceTrans;
  }
  if (!$isNull(request.forceUpgrade)) {
    query['ForceUpgrade'] = request.forceUpgrade;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.majorVersion)) {
    query['MajorVersion'] = request.majorVersion;
  }
  if (!$isNull(request.nodeType)) {
    query['NodeType'] = request.nodeType;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.readOnlyCount)) {
    query['ReadOnlyCount'] = request.readOnlyCount;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.replicaCount)) {
    query['ReplicaCount'] = request.replicaCount;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.shardCount)) {
    query['ShardCount'] = request.shardCount;
  }
  if (!$isNull(request.slaveReadOnlyCount)) {
    query['SlaveReadOnlyCount'] = request.slaveReadOnlyCount;
  }
  if (!$isNull(request.slaveReplicaCount)) {
    query['SlaveReplicaCount'] = request.slaveReplicaCount;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  if (!$isNull(request.storage)) {
    query['Storage'] = request.storage;
  }
  if (!$isNull(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceSpec',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the configurations of a Tair (Redis OSS-compatible) instance.
 *
 * @description >  For more information about the procedure, impacts, limits, and fees of this operation, see [Change the configurations of an instance](https://help.aliyun.com/document_detail/26353.html).
 *
 * @param request ModifyInstanceSpecRequest
 * @return ModifyInstanceSpecResponse
 */
async function modifyInstanceSpec(request: ModifyInstanceSpecRequest): ModifyInstanceSpecResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceSpecWithOptions(request, runtime);
}

model ModifyInstanceTDERequest {
  encryptionKey?: string(name='EncryptionKey', description='The ID of the custom key. You can call the [DescribeEncryptionKeyList](https://help.aliyun.com/document_detail/473860.html) operation to query the key ID.

> 

*   If you do not specify this parameter, [Key Management Service (KMS)](https://help.aliyun.com/document_detail/28935.html) automatically generates a key.

*   To create a custom key, you can call the [CreateKey](https://help.aliyun.com/document_detail/28947.html) operation of the KMS API.', example='ad463061-992d-4195-8a94-ed63********'),
  encryptionName?: string(name='EncryptionName', description='The encryption algorithm. Default value: AES-CTR-256.

> This parameter is available only if the **TDEStatus** parameter is set to **Enabled**.', example='AES-CTR-256'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleArn?: string(name='RoleArn', description='The Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role that you want to attach to your Tair (Redis OSS-compatible) instance. The ARN must be in the format of `acs:ram::$accountID:role/$roleName`. After the role is attached, your Tair (Redis OSS-compatible) instance can use KMS.

> 

*   `$accountID`: the ID of the Alibaba Cloud account. To view the account ID, log on to the Alibaba Cloud console, move the pointer over your profile picture in the upper-right corner of the page, and then click **Security Settings**.

*   `$roleName`: the name of the RAM role. Replace $roleName with **AliyunRdsInstanceEncryptionDefaultRole**.', example='acs:ram::123456789012****:role/AliyunRdsInstanceEncryptionDefaultRole'),
  securityToken?: string(name='SecurityToken'),
  TDEStatus?: string(name='TDEStatus', description='Specifies whether to enable TDE. Set the value to **Enabled**.

> TDE cannot be disabled after it is enabled. Before you enable it, evaluate whether this feature affects your business. For more information, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).

This parameter is required.', example='Enabled'),
}

model ModifyInstanceTDEResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model ModifyInstanceTDEResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceTDEResponseBody(name='body'),
}

/**
 * @summary Enables transparent data encryption (TDE) for a Tair (Redis OSS-compatible) instance. You can use existing custom keys.
 *
 * @description > For more information about TDE and the impact of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 *
 * @param request ModifyInstanceTDERequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceTDEResponse
 */
async function modifyInstanceTDEWithOptions(request: ModifyInstanceTDERequest, runtime: $RuntimeOptions): ModifyInstanceTDEResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.encryptionKey)) {
    query['EncryptionKey'] = request.encryptionKey;
  }
  if (!$isNull(request.encryptionName)) {
    query['EncryptionName'] = request.encryptionName;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.roleArn)) {
    query['RoleArn'] = request.roleArn;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.TDEStatus)) {
    query['TDEStatus'] = request.TDEStatus;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceTDE',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables transparent data encryption (TDE) for a Tair (Redis OSS-compatible) instance. You can use existing custom keys.
 *
 * @description > For more information about TDE and the impact of TDE, see [Enable TDE](https://help.aliyun.com/document_detail/265913.html).
 *
 * @param request ModifyInstanceTDERequest
 * @return ModifyInstanceTDEResponse
 */
async function modifyInstanceTDE(request: ModifyInstanceTDERequest): ModifyInstanceTDEResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceTDEWithOptions(request, runtime);
}

model ModifyInstanceVpcAuthModeRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  vpcAuthMode?: string(name='VpcAuthMode', description='Specifies whether to disable password-free access. Valid values:

*   **Open**: disables password-free access.
*   **Close**: enables password-free access.

**

**Description** Default value: **Open**.

This parameter is required.', example='Close'),
}

model ModifyInstanceVpcAuthModeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='ABAF95F6-35C1-4177-AF3A-70969EBD****'),
}

model ModifyInstanceVpcAuthModeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceVpcAuthModeResponseBody(name='body'),
}

/**
 * @summary Enables or disables password-free access for an ApsaraDB for Redis instance. This way, you can connect to a database in a convenient and secure manner.
 *
 * @description When the password-free access feature is enabled, Elastic Compute Service (ECS) instances in the same virtual private cloud (VPC) can connect to the ApsaraDB for Redis instance without a password. You can also use the username and password to connect to the ApsaraDB for Redis instance.
 * > The ApsaraDB for Redis instance is deployed in a VPC. For more information, see [Enable password-free access](https://help.aliyun.com/document_detail/85168.html).
 *
 * @param request ModifyInstanceVpcAuthModeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceVpcAuthModeResponse
 */
async function modifyInstanceVpcAuthModeWithOptions(request: ModifyInstanceVpcAuthModeRequest, runtime: $RuntimeOptions): ModifyInstanceVpcAuthModeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.vpcAuthMode)) {
    query['VpcAuthMode'] = request.vpcAuthMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyInstanceVpcAuthMode',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables password-free access for an ApsaraDB for Redis instance. This way, you can connect to a database in a convenient and secure manner.
 *
 * @description When the password-free access feature is enabled, Elastic Compute Service (ECS) instances in the same virtual private cloud (VPC) can connect to the ApsaraDB for Redis instance without a password. You can also use the username and password to connect to the ApsaraDB for Redis instance.
 * > The ApsaraDB for Redis instance is deployed in a VPC. For more information, see [Enable password-free access](https://help.aliyun.com/document_detail/85168.html).
 *
 * @param request ModifyInstanceVpcAuthModeRequest
 * @return ModifyInstanceVpcAuthModeResponse
 */
async function modifyInstanceVpcAuthMode(request: ModifyInstanceVpcAuthModeRequest): ModifyInstanceVpcAuthModeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyInstanceVpcAuthModeWithOptions(request, runtime);
}

model ModifyIntranetAttributeRequest {
  bandWidth?: long(name='BandWidth', description='The amount of bandwidth that you want to add. Unit: Mbit/s. The value must be an integer greater than or equal to 0. In most cases, the maximum bandwidth that can be added can be two times the default maximum bandwidth of the current instance type. For more information about the bandwidth specifications supported by different instance types, see [Overview](https://help.aliyun.com/document_detail/26350.html). The bandwidth is also subject to the following limits:

*   The bandwidth of an individual instance cannot exceed 75% of the bandwidth of the host. For more information about the host specifications and bandwidth, see [Instance types of hosts](https://help.aliyun.com/document_detail/206343.html).
*   The total bandwidth of all of the instances on the host cannot exceed 150% of the bandwidth of the host. You can configure resource overcommitment to handle traffic spikes. For more information, see [Configure resource overcommitment to reduce costs](https://help.aliyun.com/document_detail/183798.html).

> If you do not specify this parameter for a standard instance, the bandwidth of the instance is set to two times that of the current bandwidth.', example='10'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the data node. You can call the [DescribeClusterMemberInfo](https://help.aliyun.com/document_detail/473783.html) operation to query the node ID. Separate multiple IDs with commas (,).

>  This parameter is required if the instance is a [cluster](https://help.aliyun.com/document_detail/52228.html) instance.', example='r-bp1zxszhcgatnx****-db-0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyIntranetAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='97AC8948-D7E4-457E-BE03-850CF04E****'),
}

model ModifyIntranetAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyIntranetAttributeResponseBody(name='body'),
}

/**
 * @summary Temporarily adjusts the internal bandwidth of a Tair (Redis OSS-compatible) instance that is deployed in a dedicated cluster.
 *
 * @description > 
 * *   This operation is applicable only to an instance that is deployed in a dedicated cluster. To adjust the bandwidth of a standard instance, call the [EnableAdditionalBandwidth](https://help.aliyun.com/document_detail/473771.html) operation.
 *
 * @param request ModifyIntranetAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyIntranetAttributeResponse
 */
async function modifyIntranetAttributeWithOptions(request: ModifyIntranetAttributeRequest, runtime: $RuntimeOptions): ModifyIntranetAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bandWidth)) {
    query['BandWidth'] = request.bandWidth;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyIntranetAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Temporarily adjusts the internal bandwidth of a Tair (Redis OSS-compatible) instance that is deployed in a dedicated cluster.
 *
 * @description > 
 * *   This operation is applicable only to an instance that is deployed in a dedicated cluster. To adjust the bandwidth of a standard instance, call the [EnableAdditionalBandwidth](https://help.aliyun.com/document_detail/473771.html) operation.
 *
 * @param request ModifyIntranetAttributeRequest
 * @return ModifyIntranetAttributeResponse
 */
async function modifyIntranetAttribute(request: ModifyIntranetAttributeRequest): ModifyIntranetAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyIntranetAttributeWithOptions(request, runtime);
}

model ModifyParameterGroupRequest {
  category?: string(name='Category', description='The service category. Valid values:

*   **standard**: Redis Open-Source Edition
*   **enterprise**: Tair (Enterprise Edition)

This parameter is required.', example='enterprise'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  parameterGroupDesc?: string(name='ParameterGroupDesc', description='The description of the parameter template. The description must be 0 to 200 characters in length.', example='test'),
  parameterGroupId?: string(name='ParameterGroupId', description='The parameter template ID.

This parameter is required.', example='sys-001****'),
  parameterGroupName?: string(name='ParameterGroupName', description='The new name of the parameter template. The name must meet the following requirements:

*   The name can contain letters, digits, and underscores (_). It must start with a letter and cannot contain Chinese characters.
*   The name can be 8 to 64 characters in length.

This parameter is required.', example='testGroupName'),
  parameters?: string(name='Parameters', description='A JSON-formatted object that specifies the parameter-value pairs. Format: {"Parameter 1":"Value 1","Parameter 2":"Value 2"...}. The specified value overwrites the original content.

>  The parameters that can be added for different editions are displayed in the console.

This parameter is required.', example='{"hz":"12"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-zhangjiakou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyParameterGroupResponseBody = {
  paramGroupId?: string(name='ParamGroupId', description='The parameter template ID.', example='testGroupName'),
  requestId?: string(name='RequestId', description='The request ID.', example='AD425AD3-CC7B-4EE2-A5CB-2F61BA73****'),
}

model ModifyParameterGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyParameterGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the settings of a parameter template.
 *
 * @param request ModifyParameterGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyParameterGroupResponse
 */
async function modifyParameterGroupWithOptions(request: ModifyParameterGroupRequest, runtime: $RuntimeOptions): ModifyParameterGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.parameterGroupDesc)) {
    query['ParameterGroupDesc'] = request.parameterGroupDesc;
  }
  if (!$isNull(request.parameterGroupId)) {
    query['ParameterGroupId'] = request.parameterGroupId;
  }
  if (!$isNull(request.parameterGroupName)) {
    query['ParameterGroupName'] = request.parameterGroupName;
  }
  if (!$isNull(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyParameterGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the settings of a parameter template.
 *
 * @param request ModifyParameterGroupRequest
 * @return ModifyParameterGroupResponse
 */
async function modifyParameterGroup(request: ModifyParameterGroupRequest): ModifyParameterGroupResponse {
  var runtime = new $RuntimeOptions{};
  return modifyParameterGroupWithOptions(request, runtime);
}

model ModifyResourceGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the generated token is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which you want to move the instance.

> *   You can query resource group IDs by using the Tair (Redis OSS-compatible) console or by calling the [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html) operation. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).
> *   Before you modify the resource group to which an instance belongs, you can call the [ListResources](https://help.aliyun.com/document_detail/158866.html) operation to view the resource group of the instance.

This parameter is required.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model ModifyResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyResourceGroupResponseBody(name='body'),
}

/**
 * @summary Changes the resource group to which a Tair (Redis OSS-compatible) instance belongs.
 *
 * @description You can also perform this operation in the [Resource Management](https://resourcemanager.console.aliyun.com/resource-center) console. For more information, see [Transfer resources across resource groups](https://help.aliyun.com/document_detail/94487.html).
 * >  Resource Group allows you to sort resources owned by your Alibaba Cloud account into groups. This simplifies the resource and permission management within your Alibaba Cloud account. For more information, see [What is Resource Management?](https://help.aliyun.com/document_detail/94475.html)
 *
 * @param request ModifyResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyResourceGroupResponse
 */
async function modifyResourceGroupWithOptions(request: ModifyResourceGroupRequest, runtime: $RuntimeOptions): ModifyResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyResourceGroup',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the resource group to which a Tair (Redis OSS-compatible) instance belongs.
 *
 * @description You can also perform this operation in the [Resource Management](https://resourcemanager.console.aliyun.com/resource-center) console. For more information, see [Transfer resources across resource groups](https://help.aliyun.com/document_detail/94487.html).
 * >  Resource Group allows you to sort resources owned by your Alibaba Cloud account into groups. This simplifies the resource and permission management within your Alibaba Cloud account. For more information, see [What is Resource Management?](https://help.aliyun.com/document_detail/94475.html)
 *
 * @param request ModifyResourceGroupRequest
 * @return ModifyResourceGroupResponse
 */
async function modifyResourceGroup(request: ModifyResourceGroupRequest): ModifyResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return modifyResourceGroupWithOptions(request, runtime);
}

model ModifySecurityGroupConfigurationRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group that you want to manage. You can specify up to 10 security groups. Separate multiple security group IDs with commas (,).

This parameter is required.', example='sg-bpcfmyiu4ekp****'),
  securityToken?: string(name='SecurityToken'),
}

model ModifySecurityGroupConfigurationResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='147CAC09-E8C6-43F8-9599-982A43D6****'),
}

model ModifySecurityGroupConfigurationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySecurityGroupConfigurationResponseBody(name='body'),
}

/**
 * @summary Resets the security groups that are added to the whitelists of an ApsaraDB for Redis instance.
 *
 * @description > After you call this operation, the security groups that are added to the whitelists of the ApsaraDB for Redis instance are deleted, and the security group specified by the **SecurityGroupId** parameter is added to the whitelists. For more information about how to reset security groups in the ApsaraDB for Redis console, see [Add security groups](https://help.aliyun.com/document_detail/148267.html).
 *
 * @param request ModifySecurityGroupConfigurationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySecurityGroupConfigurationResponse
 */
async function modifySecurityGroupConfigurationWithOptions(request: ModifySecurityGroupConfigurationRequest, runtime: $RuntimeOptions): ModifySecurityGroupConfigurationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifySecurityGroupConfiguration',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Resets the security groups that are added to the whitelists of an ApsaraDB for Redis instance.
 *
 * @description > After you call this operation, the security groups that are added to the whitelists of the ApsaraDB for Redis instance are deleted, and the security group specified by the **SecurityGroupId** parameter is added to the whitelists. For more information about how to reset security groups in the ApsaraDB for Redis console, see [Add security groups](https://help.aliyun.com/document_detail/148267.html).
 *
 * @param request ModifySecurityGroupConfigurationRequest
 * @return ModifySecurityGroupConfigurationResponse
 */
async function modifySecurityGroupConfiguration(request: ModifySecurityGroupConfigurationRequest): ModifySecurityGroupConfigurationResponse {
  var runtime = new $RuntimeOptions{};
  return modifySecurityGroupConfigurationWithOptions(request, runtime);
}

model ModifySecurityIpsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  modifyMode?: string(name='ModifyMode', description='The method that is used to modify the whitelist. Valid values:

*   **Cover** (default): overwrites the original whitelist.
*   **Append**: appends data to the whitelist.
*   **Delete**: deletes the whitelist.', example='Append'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIpGroupAttribute?: string(name='SecurityIpGroupAttribute', description='By default, this parameter is left empty. The attribute of the whitelist. The console does not display the whitelist whose value of this parameter is **hidden**.', example='hidden'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the IP address whitelist.
>Warning: You cannot modify the whitelist that is generated by the system. If you do not specify this parameter, the default whitelist is modified by default.', example='default'),
  securityIps?: string(name='SecurityIps', description='The IP addresses in the whitelist. Up to 1,000 IP addresses can be specified in a whitelist. Separate multiple IP addresses with a comma (,). Specify an IP address in the 0.0.0.0/0, 10.23.12.24, or 10.23.12.24/24 format. In CIDR block 10.23.12.24/24, /24 specifies the length of the prefix of an IP address. The prefix length ranges from 1 to 32.

This parameter is required.', example='100.64.***.0/24,10.101.11.***'),
  securityToken?: string(name='SecurityToken'),
}

model ModifySecurityIpsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='AAAF99B1-69ED-4E80-8CD5-272C09E4****'),
}

model ModifySecurityIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySecurityIpsResponseBody(name='body'),
}

/**
 * @summary Modifies the IP address whitelists of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also modify the whitelists of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Configure a whitelist for an instance](https://help.aliyun.com/document_detail/56464.html).
 *
 * @param request ModifySecurityIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIpsWithOptions(request: ModifySecurityIpsRequest, runtime: $RuntimeOptions): ModifySecurityIpsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.modifyMode)) {
    query['ModifyMode'] = request.modifyMode;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityIpGroupAttribute)) {
    query['SecurityIpGroupAttribute'] = request.securityIpGroupAttribute;
  }
  if (!$isNull(request.securityIpGroupName)) {
    query['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  if (!$isNull(request.securityIps)) {
    query['SecurityIps'] = request.securityIps;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifySecurityIps',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the IP address whitelists of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also modify the whitelists of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Configure a whitelist for an instance](https://help.aliyun.com/document_detail/56464.html).
 *
 * @param request ModifySecurityIpsRequest
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIps(request: ModifySecurityIpsRequest): ModifySecurityIpsResponse {
  var runtime = new $RuntimeOptions{};
  return modifySecurityIpsWithOptions(request, runtime);
}

model ModifyTairKVCacheCustomInstanceAttributeRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='r-bp1zxszhcgatnx****'),
  instanceName?: string(name='InstanceName', description='This parameter is required.', example='redistest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', example='SDK'),
}

model ModifyTairKVCacheCustomInstanceAttributeResponseBody = {
  requestId?: string(name='RequestId', example='2FF6158E-3394-4A90-B634-79C49184****'),
}

model ModifyTairKVCacheCustomInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTairKVCacheCustomInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary 修改TairCustom实例基本参数
 *
 * @param request ModifyTairKVCacheCustomInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTairKVCacheCustomInstanceAttributeResponse
 */
async function modifyTairKVCacheCustomInstanceAttributeWithOptions(request: ModifyTairKVCacheCustomInstanceAttributeRequest, runtime: $RuntimeOptions): ModifyTairKVCacheCustomInstanceAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyTairKVCacheCustomInstanceAttribute',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改TairCustom实例基本参数
 *
 * @param request ModifyTairKVCacheCustomInstanceAttributeRequest
 * @return ModifyTairKVCacheCustomInstanceAttributeResponse
 */
async function modifyTairKVCacheCustomInstanceAttribute(request: ModifyTairKVCacheCustomInstanceAttributeRequest): ModifyTairKVCacheCustomInstanceAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyTairKVCacheCustomInstanceAttributeWithOptions(request, runtime);
}

model ModifyTaskInfoRequest {
  actionParams?: string(name='ActionParams', description='The JSON-formatted parameters related to the action. Set this parameter to `{"recoverMode": "xxx", "recoverTime": "xxx"}` if the **TaskAction** parameter is set to **modifySwitchTime**.

*   **recoverMode**: specifies the restoration mode for the task. Valid values:

    *   **timePoint**: performs the task at the specified point in time.
    *   **immediate**: performs the task immediately.
    *   **maintainTime**: performs the task within the maintenance window.

*   **recoverTime**: specifies the point in time for restoration. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. This parameter is required if the **recoverMode** parameter is set to **timePoint**.', example='{\\\\"recoverMode\\\\":\\\\"immediate\\\\"}'),
  regionId?: string(name='RegionId', description='The ID of the region where the instance is deployed.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  stepName?: string(name='StepName', description='The name of the current step.', example='exec_task'),
  taskAction?: string(name='TaskAction', description='The action name. Set the value to **modifySwitchTime**. The value specifies that you want to change the switching time or restoration time.', example='modifySwitchTime'),
  taskId?: string(name='TaskId', description='The task ID. Separate multiple task IDs with commas (,). You can specify up to 30 task IDs.

This parameter is required.', example='t-0mq3kfhn8i1nlt****'),
}

model ModifyTaskInfoResponseBody = {
  errorCode?: string(name='ErrorCode', description='The error code returned if a task fails.', example='mst.errorcode.success.errormessage'),
  errorTaskId?: string(name='ErrorTaskId', description='The ID of the failed task. This parameter is returned if a task fails.', example='t-0mqaj5hnyofczv****'),
  requestId?: string(name='RequestId', description='The request ID.', example='2B98499B-E62B-56D4-8D7F-3D6D4DB260F2'),
  successCount?: string(name='SuccessCount', description='The number of completed tasks.', example='2'),
}

model ModifyTaskInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTaskInfoResponseBody(name='body'),
}

/**
 * @summary Modifies the task information, such as the task execution time.
 *
 * @param request ModifyTaskInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTaskInfoResponse
 */
async function modifyTaskInfoWithOptions(request: ModifyTaskInfoRequest, runtime: $RuntimeOptions): ModifyTaskInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.actionParams)) {
    query['ActionParams'] = request.actionParams;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.stepName)) {
    query['StepName'] = request.stepName;
  }
  if (!$isNull(request.taskAction)) {
    query['TaskAction'] = request.taskAction;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyTaskInfo',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the task information, such as the task execution time.
 *
 * @param request ModifyTaskInfoRequest
 * @return ModifyTaskInfoResponse
 */
async function modifyTaskInfo(request: ModifyTaskInfoRequest): ModifyTaskInfoResponse {
  var runtime = new $RuntimeOptions{};
  return modifyTaskInfoWithOptions(request, runtime);
}

model ReleaseDirectConnectionRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ReleaseDirectConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model ReleaseDirectConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseDirectConnectionResponseBody(name='body'),
}

/**
 * @summary Releases the private endpoint of an ApsaraDB for Redis cluster instance.
 *
 * @description In direct connection mode, clients can bypass proxy nodes and use private endpoints to connect to ApsaraDB for Redis instances. This is similar to the connection to a native Redis cluster. The direct connection mode can reduce communication overheads and the response time of ApsaraDB for Redis. For more information, see [Enable the direct connection mode](https://help.aliyun.com/document_detail/146901.html).
 *
 * @param request ReleaseDirectConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseDirectConnectionResponse
 */
async function releaseDirectConnectionWithOptions(request: ReleaseDirectConnectionRequest, runtime: $RuntimeOptions): ReleaseDirectConnectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReleaseDirectConnection',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Releases the private endpoint of an ApsaraDB for Redis cluster instance.
 *
 * @description In direct connection mode, clients can bypass proxy nodes and use private endpoints to connect to ApsaraDB for Redis instances. This is similar to the connection to a native Redis cluster. The direct connection mode can reduce communication overheads and the response time of ApsaraDB for Redis. For more information, see [Enable the direct connection mode](https://help.aliyun.com/document_detail/146901.html).
 *
 * @param request ReleaseDirectConnectionRequest
 * @return ReleaseDirectConnectionResponse
 */
async function releaseDirectConnection(request: ReleaseDirectConnectionRequest): ReleaseDirectConnectionResponse {
  var runtime = new $RuntimeOptions{};
  return releaseDirectConnectionWithOptions(request, runtime);
}

model ReleaseInstancePublicConnectionRequest {
  currentConnectionString?: string(name='CurrentConnectionString', description='The public endpoint to be released.

This parameter is required.', example='r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ReleaseInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='88F850B5-CC68-48B4-83CA-5497C3C191DE'),
}

model ReleaseInstancePublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseInstancePublicConnectionResponseBody(name='body'),
}

/**
 * @summary Releases the public endpoint of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also release the public endpoint for an instance in the Tair (Redis OSS-compatible) console. For more information, see [Release public endpoints](https://help.aliyun.com/document_detail/125424.html).
 *
 * @param request ReleaseInstancePublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseInstancePublicConnectionResponse
 */
async function releaseInstancePublicConnectionWithOptions(request: ReleaseInstancePublicConnectionRequest, runtime: $RuntimeOptions): ReleaseInstancePublicConnectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentConnectionString)) {
    query['CurrentConnectionString'] = request.currentConnectionString;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReleaseInstancePublicConnection',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Releases the public endpoint of a Tair (Redis OSS-compatible) instance.
 *
 * @description You can also release the public endpoint for an instance in the Tair (Redis OSS-compatible) console. For more information, see [Release public endpoints](https://help.aliyun.com/document_detail/125424.html).
 *
 * @param request ReleaseInstancePublicConnectionRequest
 * @return ReleaseInstancePublicConnectionResponse
 */
async function releaseInstancePublicConnection(request: ReleaseInstancePublicConnectionRequest): ReleaseInstancePublicConnectionResponse {
  var runtime = new $RuntimeOptions{};
  return releaseInstancePublicConnectionWithOptions(request, runtime);
}

model RemoveSubInstanceRequest {
  instanceId?: string(name='InstanceId', description='Instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model RemoveSubInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model RemoveSubInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveSubInstanceResponseBody(name='body'),
}

/**
 * @summary Removes a child instance from a distributed instance.
 *
 * @description The operation that you want to perform. Set the value to **RemoveSubInstance**.
 *
 * @param request RemoveSubInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveSubInstanceResponse
 */
async function removeSubInstanceWithOptions(request: RemoveSubInstanceRequest, runtime: $RuntimeOptions): RemoveSubInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveSubInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes a child instance from a distributed instance.
 *
 * @description The operation that you want to perform. Set the value to **RemoveSubInstance**.
 *
 * @param request RemoveSubInstanceRequest
 * @return RemoveSubInstanceResponse
 */
async function removeSubInstance(request: RemoveSubInstanceRequest): RemoveSubInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return removeSubInstanceWithOptions(request, runtime);
}

model RenewAdditionalBandwidthRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Default value: true. Valid values:

*   **true**: enables automatic payment.
*   **false**: disables automatic payment. If automatic payment is disabled, you must perform the following steps to complete the payment in the Tair (Redis OSS-compatible) console: In the top navigation bar, choose **Expenses** > **Renewal Management**. In the left-side navigation pane, click **Orders**. On the **Orders** page, find the order and complete the payment.', example='true'),
  couponNo?: string(name='CouponNo', description='The ID of the coupon.', example='youhuiquan_promotion_option_id_for_blank'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  orderTimeLength?: string(name='OrderTimeLength', description='The validity period of the bandwidth that you purchase. Unit: days. Valid values: **1**, **2**, **3**, **7**, **14**, **30**, **60**, **90**, **180**, **365**, **730**, **1095**, and **1825**.

This parameter is required.', example='30'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='The source of the operation. This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
}

model RenewAdditionalBandwidthResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='2084452111111'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model RenewAdditionalBandwidthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewAdditionalBandwidthResponseBody(name='body'),
}

/**
 * @summary This operation is not recommended now. The billing method for bandwidth of a Tair (Redis OSS-compatible) instance is changed to pay-as-you-go.
 *
 * @description You can adjust the bandwidth of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Adjust the bandwidth of an instance](https://help.aliyun.com/document_detail/102588.html). You can also call the [EnableAdditionalBandwidth](https://help.aliyun.com/document_detail/473771.html) operation to purchase bandwidth for an instance.
 *
 * @param request RenewAdditionalBandwidthRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewAdditionalBandwidthResponse
 */
async function renewAdditionalBandwidthWithOptions(request: RenewAdditionalBandwidthRequest, runtime: $RuntimeOptions): RenewAdditionalBandwidthResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.orderTimeLength)) {
    query['OrderTimeLength'] = request.orderTimeLength;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RenewAdditionalBandwidth',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary This operation is not recommended now. The billing method for bandwidth of a Tair (Redis OSS-compatible) instance is changed to pay-as-you-go.
 *
 * @description You can adjust the bandwidth of an instance in the Tair (Redis OSS-compatible) console. For more information, see [Adjust the bandwidth of an instance](https://help.aliyun.com/document_detail/102588.html). You can also call the [EnableAdditionalBandwidth](https://help.aliyun.com/document_detail/473771.html) operation to purchase bandwidth for an instance.
 *
 * @param request RenewAdditionalBandwidthRequest
 * @return RenewAdditionalBandwidthResponse
 */
async function renewAdditionalBandwidth(request: RenewAdditionalBandwidthRequest): RenewAdditionalBandwidthResponse {
  var runtime = new $RuntimeOptions{};
  return renewAdditionalBandwidthWithOptions(request, runtime);
}

model RenewInstanceRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Default value: true. Valid values:

*   **true**: enables automatic payment.
*   **false**: disables automatic payment.

If you select false, you must choose **Expenses** > **Renewal Management** in the top navigation bar. In the left-side navigation pane, click **Orders**. Find the specified order and pay for it.', example='true'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Valid values:

*   **true**: enables auto-renewal. The instance is renewed based on the specified renewal duration. For example, if you set the renewal duration to three months, you are charged for three months of service each time the instance is automatically renewed.
*   **false** (default): disables auto-renewal.', example='false'),
  businessInfo?: string(name='BusinessInfo', description='The ID of the promotional event or business information.', example='000000000'),
  capacity?: string(name='Capacity', description='The storage capacity of the instance. Unit: MB. When you renew the instance, you can specify this parameter to change specifications of the instance.

> To change the specifications when you renew the instance, you must specify at least one of the `Capacity` and `InstanceClass` parameters.', example='1024'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token is case-sensitive. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='TF-ModifyInstanceSpec-1686645570-7dac7257-4a14-4811-939c-51a282f'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  fromApp?: string(name='FromApp', description='The source of the request. The default value is **OpenAPI** and cannot be changed.', example='OpenAPI'),
  instanceClass?: string(name='InstanceClass', description='The instance type code. For more information, see [Instance specifications overview](https://help.aliyun.com/document_detail/26350.html). When you renew the instance, you can specify this parameter to change specifications of the instance.

> To change the specifications when you renew the instance, you must specify at least one of the `Capacity` and `InstanceClass` parameters.', example='redis.master.small.default'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: long(name='Period', description='The renewal period. Valid values: **1**, 2, 3, 4, 5, 6, 7, 8, **9**, **12**, **24**, and **36**. Unit: months.

This parameter is required.', example='6'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model RenewInstanceResponseBody = {
  endTime?: string(name='EndTime', description='The end time of the order.', example='2019-02-19T00:00:00Z'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='111111111111111'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2222245-222A-4155-9349-E22222****'),
}

model RenewInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewInstanceResponseBody(name='body'),
}

/**
 * @summary Renews an ApsaraDB for Redis instance.
 *
 * @description This operation is applicable only to subscription instances.
 *
 * @param request RenewInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewInstanceResponse
 */
async function renewInstanceWithOptions(request: RenewInstanceRequest, runtime: $RuntimeOptions): RenewInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!$isNull(request.capacity)) {
    query['Capacity'] = request.capacity;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!$isNull(request.fromApp)) {
    query['FromApp'] = request.fromApp;
  }
  if (!$isNull(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RenewInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Renews an ApsaraDB for Redis instance.
 *
 * @description This operation is applicable only to subscription instances.
 *
 * @param request RenewInstanceRequest
 * @return RenewInstanceResponse
 */
async function renewInstance(request: RenewInstanceRequest): RenewInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return renewInstanceWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  accountName?: string(name='AccountName', description='The name of the account. You can call the [DescribeAccounts](~~DescribeAccounts~~) operation to obtain the name of the account.

This parameter is required.', example='demoaccount'),
  accountPassword?: string(name='AccountPassword', description='The new password for the account. The password must be 8 to 32 characters in length. It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include `!@ # $ % ^ & * ( ) _ + - =`

This parameter is required.', example='uWonno_221****'),
  instanceId?: string(name='InstanceId', description='The ID of the instance to which the account belongs.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', description='This parameter is used only for internal maintenance. You do not need to specify this parameter.', example='SDK'),
}

model ResetAccountPasswordResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8BE02313-5395-4EBE-BAE7-E90A053F****'),
}

model ResetAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAccountPasswordResponseBody(name='body'),
}

/**
 * @summary Resets the password of an account for a Tair (Redis OSS-compatible) instance.
 *
 * @description >  Only Tair (Redis OSS-compatible) instances of Redis 4.0 or later are supported.
 *
 * @param request ResetAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: $RuntimeOptions): ResetAccountPasswordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetAccountPassword',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Resets the password of an account for a Tair (Redis OSS-compatible) instance.
 *
 * @description >  Only Tair (Redis OSS-compatible) instances of Redis 4.0 or later are supported.
 *
 * @param request ResetAccountPasswordRequest
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new $RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model ResetTairKVCacheCustomInstancePasswordRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', description='This parameter is required.', example='Pass!123456'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  sourceBiz?: string(name='SourceBiz', example='SDK'),
}

model ResetTairKVCacheCustomInstancePasswordResponseBody = {
  requestId?: string(name='RequestId', example='AD425AD3-CC7B-4EE2-A5CB-2F61BA73****'),
}

model ResetTairKVCacheCustomInstancePasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetTairKVCacheCustomInstancePasswordResponseBody(name='body'),
}

/**
 * @summary 重置TairCustom上主机密码
 *
 * @param request ResetTairKVCacheCustomInstancePasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetTairKVCacheCustomInstancePasswordResponse
 */
async function resetTairKVCacheCustomInstancePasswordWithOptions(request: ResetTairKVCacheCustomInstancePasswordRequest, runtime: $RuntimeOptions): ResetTairKVCacheCustomInstancePasswordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.password)) {
    query['Password'] = request.password;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sourceBiz)) {
    query['SourceBiz'] = request.sourceBiz;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetTairKVCacheCustomInstancePassword',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 重置TairCustom上主机密码
 *
 * @param request ResetTairKVCacheCustomInstancePasswordRequest
 * @return ResetTairKVCacheCustomInstancePasswordResponse
 */
async function resetTairKVCacheCustomInstancePassword(request: ResetTairKVCacheCustomInstancePasswordRequest): ResetTairKVCacheCustomInstancePasswordResponse {
  var runtime = new $RuntimeOptions{};
  return resetTairKVCacheCustomInstancePasswordWithOptions(request, runtime);
}

model ResizeTairKVCacheCustomInstanceDiskRequest {
  autoPay?: boolean(name='AutoPay', example='true'),
  diskId?: string(name='DiskId', description='This parameter is required.', example='d-5v1aggi3ffoxufb57**'),
  diskSize?: string(name='DiskSize', example='5000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='tc-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ResizeTairKVCacheCustomInstanceDiskResponseBody = {
  orderId?: string(name='OrderId', example='20905403119****'),
  requestId?: string(name='RequestId', example='ABAF95F6-35C1-4177-AF3A-70969EBD****'),
}

model ResizeTairKVCacheCustomInstanceDiskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResizeTairKVCacheCustomInstanceDiskResponseBody(name='body'),
}

/**
 * @summary 变配TairCustom的主机的磁盘
 *
 * @param request ResizeTairKVCacheCustomInstanceDiskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResizeTairKVCacheCustomInstanceDiskResponse
 */
async function resizeTairKVCacheCustomInstanceDiskWithOptions(request: ResizeTairKVCacheCustomInstanceDiskRequest, runtime: $RuntimeOptions): ResizeTairKVCacheCustomInstanceDiskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.diskId)) {
    query['DiskId'] = request.diskId;
  }
  if (!$isNull(request.diskSize)) {
    query['DiskSize'] = request.diskSize;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResizeTairKVCacheCustomInstanceDisk',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 变配TairCustom的主机的磁盘
 *
 * @param request ResizeTairKVCacheCustomInstanceDiskRequest
 * @return ResizeTairKVCacheCustomInstanceDiskResponse
 */
async function resizeTairKVCacheCustomInstanceDisk(request: ResizeTairKVCacheCustomInstanceDiskRequest): ResizeTairKVCacheCustomInstanceDiskResponse {
  var runtime = new $RuntimeOptions{};
  return resizeTairKVCacheCustomInstanceDiskWithOptions(request, runtime);
}

model RestartInstanceRequest {
  effectiveTime?: string(name='EffectiveTime', description='The time when you want to restart the instance. Default value: Immediately. Valid values:

*   **Immediately**: immediately restarts the instance.
*   **MaintainTime**: restarts the instance during the maintenance window.', example='Immediately'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  upgradeMinorVersion?: boolean(name='UpgradeMinorVersion', description='Specifies whether to update to the latest minor version when the instance is restarted. Valid values:

*   **true**: updates the minor version.
*   **false**: does not update the minor version.

> The default value is **true**.', example='true'),
}

model RestartInstanceResponseBody = {
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EFC9161F-15E3-4A6E-8A99-C33331****'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='11111****'),
}

model RestartInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartInstanceResponseBody(name='body'),
}

/**
 * @summary Restarts a running ApsaraDB for Redis instance.
 *
 * @param request RestartInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartInstanceResponse
 */
async function restartInstanceWithOptions(request: RestartInstanceRequest, runtime: $RuntimeOptions): RestartInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.upgradeMinorVersion)) {
    query['UpgradeMinorVersion'] = request.upgradeMinorVersion;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestartInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restarts a running ApsaraDB for Redis instance.
 *
 * @param request RestartInstanceRequest
 * @return RestartInstanceResponse
 */
async function restartInstance(request: RestartInstanceRequest): RestartInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return restartInstanceWithOptions(request, runtime);
}

model RestartTairKVCacheCustomInstanceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model RestartTairKVCacheCustomInstanceResponseBody = {
  instanceId?: string(name='InstanceId', example='tc-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
  taskId?: string(name='TaskId', example='578678678'),
}

model RestartTairKVCacheCustomInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartTairKVCacheCustomInstanceResponseBody(name='body'),
}

/**
 * @summary 重启TairCustom的主机
 *
 * @param request RestartTairKVCacheCustomInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartTairKVCacheCustomInstanceResponse
 */
async function restartTairKVCacheCustomInstanceWithOptions(request: RestartTairKVCacheCustomInstanceRequest, runtime: $RuntimeOptions): RestartTairKVCacheCustomInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestartTairKVCacheCustomInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 重启TairCustom的主机
 *
 * @param request RestartTairKVCacheCustomInstanceRequest
 * @return RestartTairKVCacheCustomInstanceResponse
 */
async function restartTairKVCacheCustomInstance(request: RestartTairKVCacheCustomInstanceRequest): RestartTairKVCacheCustomInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return restartTairKVCacheCustomInstanceWithOptions(request, runtime);
}

model RestoreInstanceRequest {
  backupId?: string(name='BackupId', description='The ID of the backup file. You can call the [DescribeBackups](https://help.aliyun.com/document_detail/473823.html) operation to query the IDs of backup files.', example='78241****'),
  filterKey?: string(name='FilterKey', description='The key that you want to restore. You can specify multiple keys. Separate multiple keys with commas (,). Regular expressions are supported.

*   If you do not specify this parameter, the entire instance is restored.
*   If you specify this parameter, only the involved keys are restored. Only classic instances support this feature.

>  In a regular expression, an asterisk (`*`) matches zero or more occurrences of a subexpression that occurs before. For example, if you set this parameter to `h.*llo`, strings such as `hllo` and `heeeello` are matched.', example='key:00000007198*'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='The point in time to which you want to restore data. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

>  The point in time cannot be earlier than the point in time when the data flashback feature is enabled.', example='2021-07-06T07:25:57Z'),
  restoreType?: string(name='RestoreType', description='The restoration mode. Valid values:

*   **0** (default): The parameter is invalid.
*   **1**: restores data to a specified point in time. You can specify this value only if the [data flashback](https://help.aliyun.com/document_detail/148479.html) feature is enabled for the instance. If you specify this value, you also need to set the **RestoreTime** parameter.', example='1'),
  securityToken?: string(name='SecurityToken'),
  timeShift?: string(name='TimeShift', description='When you restore a classic instance, regardless of whether you choose to restore all data or specific keys, you can apply an offset to the expiration time of the keys. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. A key expires after the remaining validity period of the key elapses based on the expiration offset time point.

> 

*   This feature applies only to keys and does not work on elements in the self-developed data structures of Tair, such as fields in exHash and skeys in TairTS.

*   This time point must be between the specified flashback time point and the submission time of the data restoration task.', example='2021-07-06T08:25:57Z'),
}

model RestoreInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8D0C0AFC-E9CD-47A4-8395-5C31BF9B****'),
}

model RestoreInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestoreInstanceResponseBody(name='body'),
}

/**
 * @summary Restores the data in a backup file to a specified ApsaraDB for Redis instance.
 *
 * @description *   If your instance is a [DRAM-based instance](https://help.aliyun.com/document_detail/126164.html) or a [persistent memory-optimized instance](https://help.aliyun.com/document_detail/183956.html) and has the [data flashback](https://help.aliyun.com/document_detail/148479.html) feature enabled, you can call this operation to restore the entire instance or specific keys to a specific point in time accurate to the second. This way, you can achieve more fine-grained data restoration.
 * *   For other types of instances, we recommend that you call the [CreateInstance](https://help.aliyun.com/document_detail/473757.html) or [CreateTairInstance](https://help.aliyun.com/document_detail/473770.html) operation to restore the backup data to a new instance.
 *
 * @param request RestoreInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestoreInstanceResponse
 */
async function restoreInstanceWithOptions(request: RestoreInstanceRequest, runtime: $RuntimeOptions): RestoreInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!$isNull(request.filterKey)) {
    query['FilterKey'] = request.filterKey;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!$isNull(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.timeShift)) {
    query['TimeShift'] = request.timeShift;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestoreInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restores the data in a backup file to a specified ApsaraDB for Redis instance.
 *
 * @description *   If your instance is a [DRAM-based instance](https://help.aliyun.com/document_detail/126164.html) or a [persistent memory-optimized instance](https://help.aliyun.com/document_detail/183956.html) and has the [data flashback](https://help.aliyun.com/document_detail/148479.html) feature enabled, you can call this operation to restore the entire instance or specific keys to a specific point in time accurate to the second. This way, you can achieve more fine-grained data restoration.
 * *   For other types of instances, we recommend that you call the [CreateInstance](https://help.aliyun.com/document_detail/473757.html) or [CreateTairInstance](https://help.aliyun.com/document_detail/473770.html) operation to restore the backup data to a new instance.
 *
 * @param request RestoreInstanceRequest
 * @return RestoreInstanceResponse
 */
async function restoreInstance(request: RestoreInstanceRequest): RestoreInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return restoreInstanceWithOptions(request, runtime);
}

model StartTairKVCacheCustomInstanceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='tc-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model StartTairKVCacheCustomInstanceResponseBody = {
  instanceId?: string(name='InstanceId', example='r-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', example='AD425AD3-CC7B-4EE2-A5CB-2F61BA73****'),
  taskId?: string(name='TaskId', example='11111****'),
}

model StartTairKVCacheCustomInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartTairKVCacheCustomInstanceResponseBody(name='body'),
}

/**
 * @summary 启动TairCustom的主机
 *
 * @param request StartTairKVCacheCustomInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartTairKVCacheCustomInstanceResponse
 */
async function startTairKVCacheCustomInstanceWithOptions(request: StartTairKVCacheCustomInstanceRequest, runtime: $RuntimeOptions): StartTairKVCacheCustomInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartTairKVCacheCustomInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 启动TairCustom的主机
 *
 * @param request StartTairKVCacheCustomInstanceRequest
 * @return StartTairKVCacheCustomInstanceResponse
 */
async function startTairKVCacheCustomInstance(request: StartTairKVCacheCustomInstanceRequest): StartTairKVCacheCustomInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return startTairKVCacheCustomInstanceWithOptions(request, runtime);
}

model StopTairKVCacheCustomInstanceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='tc-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model StopTairKVCacheCustomInstanceResponseBody = {
  instanceId?: string(name='InstanceId', example='tc-bp1zxszhcgatnx****'),
  requestId?: string(name='RequestId', example='20C8341E-B5AD-4B24-BD82-D73241522ABF'),
  taskId?: string(name='TaskId', example='578678678'),
}

model StopTairKVCacheCustomInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopTairKVCacheCustomInstanceResponseBody(name='body'),
}

/**
 * @summary 停止TairCustom的主机
 *
 * @param request StopTairKVCacheCustomInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopTairKVCacheCustomInstanceResponse
 */
async function stopTairKVCacheCustomInstanceWithOptions(request: StopTairKVCacheCustomInstanceRequest, runtime: $RuntimeOptions): StopTairKVCacheCustomInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopTairKVCacheCustomInstance',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 停止TairCustom的主机
 *
 * @param request StopTairKVCacheCustomInstanceRequest
 * @return StopTairKVCacheCustomInstanceResponse
 */
async function stopTairKVCacheCustomInstance(request: StopTairKVCacheCustomInstanceRequest): StopTairKVCacheCustomInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return stopTairKVCacheCustomInstanceWithOptions(request, runtime);
}

model SwitchInstanceHARequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  nodeId?: string(name='NodeId', description='The ID of the data shard. You can call the [DescribeRoleZoneInfo](https://help.aliyun.com/document_detail/473782.html) operation to obtain the value of the CustinsId parameter. Separate multiple data shard IDs with commas (,). `all` indicates that all data shards are specified.

> This parameter is available and required only for read/write splitting and cluster instances.', example='56****19,56****20'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  switchMode?: int32(name='SwitchMode', description='The time when to perform the switchover. Default value: 0. Valid values:

*   **0**: immediately performs the switchover.
*   **1**: performs the switchover during the maintenance window.

> You can call the [ModifyInstanceMaintainTime](https://help.aliyun.com/document_detail/473775.html) operation to modify the maintenance window of a Tair (Redis OSS-compatible) instance.', example='0'),
  switchType?: string(name='SwitchType', description='The switching mode. Valid values:

*   **AvailablePriority**: immediately performs a switchover by prioritizing availability. No latency of data synchronization between the master and replica nodes is considered. This may cause data loss.
*   **ReliabilityPriority**: performs a switchover by prioritizing reliability. Make sure that no latency of data synchronization between the master and replica nodes exists. This ensures data integrity. This mode may cause switchover failures in scenarios where a large volume of data is written and data synchronization latency consistently exists.

>  You must evaluate the requirements for data and services based on your business scenarios and then select a switching mode.', example='AvailablePriority'),
}

model SwitchInstanceHAResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model SwitchInstanceHAResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchInstanceHAResponseBody(name='body'),
}

/**
 * @summary Performs a master-replica switchover to switch node roles. This operation is applicable to disaster recovery drills and nearby access to applications that are deployed across zones.
 *
 * @description > For more information about nearby access to applications that are deployed across zones, see [Switch node roles](https://help.aliyun.com/document_detail/164222.html).
 * The instance must be a Redis Open-Source Edition instance or Tair (Enterprise Edition) [DRAM-based](https://help.aliyun.com/document_detail/126164.html) instance that uses local disks.
 * A call to this operation has the following impacts on your instance:
 * *   The data shards in the instance may change to the read-only state and experience transient connections within seconds. Make sure that your application is configured to automatically reconnect to the instance.
 * *   If the instance enters the switching state, you cannot manage this instance. For example, you cannot modify the instance configurations or migrate the instance to another zone.
 *
 * @param request SwitchInstanceHARequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchInstanceHAResponse
 */
async function switchInstanceHAWithOptions(request: SwitchInstanceHARequest, runtime: $RuntimeOptions): SwitchInstanceHAResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  if (!$isNull(request.switchType)) {
    query['SwitchType'] = request.switchType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchInstanceHA',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Performs a master-replica switchover to switch node roles. This operation is applicable to disaster recovery drills and nearby access to applications that are deployed across zones.
 *
 * @description > For more information about nearby access to applications that are deployed across zones, see [Switch node roles](https://help.aliyun.com/document_detail/164222.html).
 * The instance must be a Redis Open-Source Edition instance or Tair (Enterprise Edition) [DRAM-based](https://help.aliyun.com/document_detail/126164.html) instance that uses local disks.
 * A call to this operation has the following impacts on your instance:
 * *   The data shards in the instance may change to the read-only state and experience transient connections within seconds. Make sure that your application is configured to automatically reconnect to the instance.
 * *   If the instance enters the switching state, you cannot manage this instance. For example, you cannot modify the instance configurations or migrate the instance to another zone.
 *
 * @param request SwitchInstanceHARequest
 * @return SwitchInstanceHAResponse
 */
async function switchInstanceHA(request: SwitchInstanceHARequest): SwitchInstanceHAResponse {
  var runtime = new $RuntimeOptions{};
  return switchInstanceHAWithOptions(request, runtime);
}

model SwitchInstanceProxyRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model SwitchInstanceProxyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model SwitchInstanceProxyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchInstanceProxyResponseBody(name='body'),
}

/**
 * @summary Enables or disables the proxy mode for a Tair (Redis OSS-compatible) cluster instance in a dedicated cluster.
 *
 * @description For more information about the proxy mode, see [Features of proxy servers](https://help.aliyun.com/document_detail/142959.html). Before you call this operation, make sure that the following requirements are met:
 * *   The instance is created by using a dedicated cluster. For more information, see [What is ApsaraDB for MyBase?](https://help.aliyun.com/document_detail/141455.html)
 * *   The instance uses the [cluster architecture](https://help.aliyun.com/document_detail/52228.html).
 * >  Before you call the SwitchInstanceProxy operation, you must call the [DescribeDedicatedClusterInstanceList](https://help.aliyun.com/document_detail/473867.html) operation and view the value of the **ProxyCount** response parameter to check whether the proxy mode is enabled. A value of 0 indicates that the proxy mode is disabled. A value that is greater than 0 indicates that the proxy mode is enabled.
 *
 * @param request SwitchInstanceProxyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchInstanceProxyResponse
 */
async function switchInstanceProxyWithOptions(request: SwitchInstanceProxyRequest, runtime: $RuntimeOptions): SwitchInstanceProxyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchInstanceProxy',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables the proxy mode for a Tair (Redis OSS-compatible) cluster instance in a dedicated cluster.
 *
 * @description For more information about the proxy mode, see [Features of proxy servers](https://help.aliyun.com/document_detail/142959.html). Before you call this operation, make sure that the following requirements are met:
 * *   The instance is created by using a dedicated cluster. For more information, see [What is ApsaraDB for MyBase?](https://help.aliyun.com/document_detail/141455.html)
 * *   The instance uses the [cluster architecture](https://help.aliyun.com/document_detail/52228.html).
 * >  Before you call the SwitchInstanceProxy operation, you must call the [DescribeDedicatedClusterInstanceList](https://help.aliyun.com/document_detail/473867.html) operation and view the value of the **ProxyCount** response parameter to check whether the proxy mode is enabled. A value of 0 indicates that the proxy mode is disabled. A value that is greater than 0 indicates that the proxy mode is enabled.
 *
 * @param request SwitchInstanceProxyRequest
 * @return SwitchInstanceProxyResponse
 */
async function switchInstanceProxy(request: SwitchInstanceProxyRequest): SwitchInstanceProxyResponse {
  var runtime = new $RuntimeOptions{};
  return switchInstanceProxyWithOptions(request, runtime);
}

model SwitchInstanceZoneFailOverRequest {
  instanceId?: string(name='InstanceId', description='The instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  siteFaultTime?: string(name='SiteFaultTime', description='The duration for which the fault lasts. Unit: minutes.

Valid values:

*   5
*   10', example='5'),
  targetZoneId?: string(name='TargetZoneId', description='The ID of the destination zone.', example='cn-hangzhou-j'),
}

model SwitchInstanceZoneFailOverResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2D9F3768-EDA9-4811-943E-42C8006E****'),
}

model SwitchInstanceZoneFailOverResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchInstanceZoneFailOverResponseBody(name='body'),
}

/**
 * @summary Switches an instance from the current zone to the specified zone in the event of a fault.
 *
 * @param request SwitchInstanceZoneFailOverRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchInstanceZoneFailOverResponse
 */
async function switchInstanceZoneFailOverWithOptions(request: SwitchInstanceZoneFailOverRequest, runtime: $RuntimeOptions): SwitchInstanceZoneFailOverResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.siteFaultTime)) {
    query['SiteFaultTime'] = request.siteFaultTime;
  }
  if (!$isNull(request.targetZoneId)) {
    query['TargetZoneId'] = request.targetZoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchInstanceZoneFailOver',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Switches an instance from the current zone to the specified zone in the event of a fault.
 *
 * @param request SwitchInstanceZoneFailOverRequest
 * @return SwitchInstanceZoneFailOverResponse
 */
async function switchInstanceZoneFailOver(request: SwitchInstanceZoneFailOverRequest): SwitchInstanceZoneFailOverResponse {
  var runtime = new $RuntimeOptions{};
  return switchInstanceZoneFailOverWithOptions(request, runtime);
}

model SwitchNetworkRequest {
  classicExpiredDays?: string(name='ClassicExpiredDays', description='The retention period of the classic network endpoint. Valid values: **14**, **30**, **60**, and **120**. Unit: days.

> 

*   This parameter is available and required only when the **RetainClassic** parameter is set to **True**.

*   After you complete the switchover operation, you can also call the [ModifyInstanceNetExpireTime](https://help.aliyun.com/document_detail/473793.html) operation to modify the retention period of the classic network endpoint.', example='30'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](https://help.aliyun.com/document_detail/473778.html) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  retainClassic?: string(name='RetainClassic', description='Specifies whether to retain the original classic network endpoint after you switch the instance from classic network to VPC. Default value: False. Valid values:

*   **True**: retains the classic network endpoint.
*   **False**: does not retain the classic network endpoint.

> This parameter is available only when the network type of the instance is classic network.', example='True'),
  securityToken?: string(name='SecurityToken'),
  targetNetworkType?: string(name='TargetNetworkType', description='The network type to which you want to switch. If you want to switch to VPC network, Set the value to **VPC**.', example='VPC'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch that belongs to the VPC to which you want to switch. You can call the [DescribeVpcs](https://help.aliyun.com/document_detail/35739.html) operation to query the vSwitch ID.

>  The vSwitch and the instance must be deployed in the same zone.', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC to which you want to switch. You can call the [DescribeVpcs](https://help.aliyun.com/document_detail/35739.html) operation to query the VPC ID.

> 

*   The VPC and the instance must be deployed in the same region.

*   After you set this parameter, you must also set the **VSwitchId** parameter.', example='vpc-bp1nme44gek34slfc****'),
}

model SwitchNetworkResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='F0997EE8-F4C2-4503-9168-85177ED78C70'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='578678678'),
}

model SwitchNetworkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchNetworkResponseBody(name='body'),
}

/**
 * @summary Changes the VPC or vSwitch of a Tair (Redis OSS-compatible) instance. If the instance is deployed in the classic network, the network type of the instance is changed from the classic network to VPC.
 *
 * @param request SwitchNetworkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchNetworkResponse
 */
async function switchNetworkWithOptions(request: SwitchNetworkRequest, runtime: $RuntimeOptions): SwitchNetworkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.classicExpiredDays)) {
    query['ClassicExpiredDays'] = request.classicExpiredDays;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.retainClassic)) {
    query['RetainClassic'] = request.retainClassic;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.targetNetworkType)) {
    query['TargetNetworkType'] = request.targetNetworkType;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchNetwork',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the VPC or vSwitch of a Tair (Redis OSS-compatible) instance. If the instance is deployed in the classic network, the network type of the instance is changed from the classic network to VPC.
 *
 * @param request SwitchNetworkRequest
 * @return SwitchNetworkResponse
 */
async function switchNetwork(request: SwitchNetworkRequest): SwitchNetworkResponse {
  var runtime = new $RuntimeOptions{};
  return switchNetworkWithOptions(request, runtime);
}

model SyncDtsStatusRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  status?: string(name='Status', description='Disables configuration changes for the instance. Valid values:

*   **0**: does not disable configuration changes.
*   **1**: disables configuration changes. In this case, if you attempt to modify the configurations of the instance, the system informs you that the operation cannot be performed.', example='0'),
  taskId?: string(name='TaskId', description='The ID of the DTS instance. You can view the ID in the [DTS console](https://dts.console.aliyun.com/).

>  A Tair (Redis OSS-compatible) instance may be involved in multiple data migration or synchronization tasks. If you want to cancel the restriction on the instance, you can specify this parameter to prevent repeated operation calls.', example='dtss0611o8vv90****'),
}

model SyncDtsStatusResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
}

model SyncDtsStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SyncDtsStatusResponseBody(name='body'),
}

/**
 * @summary Disables configuration changes for a Tair (Redis OSS-compatible) instance before you use Data Transmission Service (DTS) to migrate or synchronize data of the instance. This prevents migration and synchronization task failures due to configuration changes.
 *
 * @param request SyncDtsStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SyncDtsStatusResponse
 */
async function syncDtsStatusWithOptions(request: SyncDtsStatusRequest, runtime: $RuntimeOptions): SyncDtsStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SyncDtsStatus',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables configuration changes for a Tair (Redis OSS-compatible) instance before you use Data Transmission Service (DTS) to migrate or synchronize data of the instance. This prevents migration and synchronization task failures due to configuration changes.
 *
 * @param request SyncDtsStatusRequest
 * @return SyncDtsStatusResponse
 */
async function syncDtsStatus(request: SyncDtsStatusRequest): SyncDtsStatusResponse {
  var runtime = new $RuntimeOptions{};
  return syncDtsStatusWithOptions(request, runtime);
}

model TagResourcesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **INSTANCE**.

This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag associated with the instance.

> * **N** specifies the serial number of the tag. For example, **Tag.1.Key** specifies the key of the first tag and **Tag.2.Key** specifies the key of the second tag.
> * If the key of the tag does not exist, the key is automatically created.

This parameter is required.', example='demokey'),
      value?: string(name='Value', description='The value of the tag associated with the instance.

> **N** specifies the serial number of the tag. For example, **Tag.1.Value** specifies the value of the first tag and **Tag.2.Value** specifies the value of the second tag.

This parameter is required.', example='demovalue'),
    }
  ](name='Tag', description='The tags of the instance.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='4BD4E308-A3D8-4CD1-98B3-0ADAEE38****'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds tags to Tair (Redis OSS-compatible) instances.
 *
 * @description If you have a large number of instances, you can create multiple tags and add these tags to the instances. Then, you can filter instances by tag.
 * *   A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can be mapped to the same value.
 * *   If the tag that you specify does not exist, this tag is automatically created and added to the specified instance.
 * *   If the key of the specified tag is the same as that of an existing tag, the specified tag overwrites the existing tag.
 * *   You can add up to 20 tags to each instance.
 * *   You can add tags to up to 50 instances in each request.
 * You can also add tags to instances in the Tair (Redis OSS-compatible) console. For more information, see [Create a tag](https://help.aliyun.com/document_detail/118779.html).
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds tags to Tair (Redis OSS-compatible) instances.
 *
 * @description If you have a large number of instances, you can create multiple tags and add these tags to the instances. Then, you can filter instances by tag.
 * *   A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can be mapped to the same value.
 * *   If the tag that you specify does not exist, this tag is automatically created and added to the specified instance.
 * *   If the key of the specified tag is the same as that of an existing tag, the specified tag overwrites the existing tag.
 * *   You can add up to 20 tags to each instance.
 * *   You can add tags to up to 50 instances in each request.
 * You can also add tags to instances in the Tair (Redis OSS-compatible) console. For more information, see [Create a tag](https://help.aliyun.com/document_detail/118779.html).
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model TransformInstanceChargeTypeRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Default value: true. Valid values:

*   **true**: Automatic payment is enabled.
*   **false**: Automatic payment is disabled. If automatic payment is disabled, you must perform the following steps to complete the payment: In the top navigation bar of the Tair (Redis OSS-compatible) console, choose **Expenses** > **Renewal Management**. In the left-side navigation pane of the Billing Management console, click **Orders**. On the **Orders** page, find the order and complete the payment.', example='true'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Valid values:

*   **true**: enables auto-renewal.
*   **false** (default): disables auto-renewal.

Valid values:

*   false
*   true', example='false'),
  autoRenewPeriod?: long(name='AutoRenewPeriod', description='The subscription duration that is supported by auto-renewal. Unit: month. Valid values: **1**, **2**, **3**, **6**, and **12**.

>  This parameter is required if the **AutoRenew** parameter is set to **true**.', example='1'),
  chargeType?: string(name='ChargeType', description='The new billing method. Valid values:

*   **PrePaid**: subscription. If you set this parameter to PrePaid, you must also specify the **Period** parameter.
*   **PostPaid**: pay-as-you-go

This parameter is required.', example='PrePaid'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](~~DescribeInstances~~) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: long(name='Period', description='The subscription duration. Unit: months. Valid values: **1**, 2, 3, 4, 5, 6, 7, 8, **9**, **12**, **24**, **36**.

>  This parameter is valid and required only if you set the **ChargeType** parameter to **PrePaid**.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model TransformInstanceChargeTypeResponseBody = {
  endTime?: string(name='EndTime', description='The time when the instance expires.

>  A value is returned for this parameter only if the instance was changed from pay-as-you-go to subscription.', example='2021-05-13T00:00:00Z'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='20881824000****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='82C791FB-8979-489E-853D-706D7743****'),
}

model TransformInstanceChargeTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransformInstanceChargeTypeResponseBody(name='body'),
}

/**
 * @summary Changes the billing method of a Tair (Redis OSS-compatible) instance from subscription to pay-as-you-go or from pay-as-you-go to subscription.
 *
 * @description Before you call this operation, make sure that you understand relevant precautions and billing rules. For more information, see the following topics:
 * *   [Change the billing method to subscription](https://help.aliyun.com/document_detail/54542.html).
 * *   [Change the billing method to pay-as-you-go](https://help.aliyun.com/document_detail/211549.html).
 *
 * @param request TransformInstanceChargeTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransformInstanceChargeTypeResponse
 */
async function transformInstanceChargeTypeWithOptions(request: TransformInstanceChargeTypeRequest, runtime: $RuntimeOptions): TransformInstanceChargeTypeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.autoRenewPeriod)) {
    query['AutoRenewPeriod'] = request.autoRenewPeriod;
  }
  if (!$isNull(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TransformInstanceChargeType',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the billing method of a Tair (Redis OSS-compatible) instance from subscription to pay-as-you-go or from pay-as-you-go to subscription.
 *
 * @description Before you call this operation, make sure that you understand relevant precautions and billing rules. For more information, see the following topics:
 * *   [Change the billing method to subscription](https://help.aliyun.com/document_detail/54542.html).
 * *   [Change the billing method to pay-as-you-go](https://help.aliyun.com/document_detail/211549.html).
 *
 * @param request TransformInstanceChargeTypeRequest
 * @return TransformInstanceChargeTypeResponse
 */
async function transformInstanceChargeType(request: TransformInstanceChargeTypeRequest): TransformInstanceChargeTypeResponse {
  var runtime = new $RuntimeOptions{};
  return transformInstanceChargeTypeWithOptions(request, runtime);
}

model TransformToPrePaidRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable auto-renewal. Default value: false. Valid values:

*   **true**: enables auto-renewal.
*   **false**: disables auto-renewal. In this case, you can renew your instance in the console. For more information, see [Manually renew an instance](https://help.aliyun.com/document_detail/26352.html).', example='true'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Valid values:

* *true*: enables auto-renewal.
* *false* (default): disables auto-renewal.', example='false'),
  autoRenewPeriod?: long(name='AutoRenewPeriod', description='The subscription duration that is supported by auto-renewal. Unit: month. Valid values: **1**, **2**, **3**, **6**, and **12**.

>  This parameter is required if the **AutoRenew** parameter is set to **true**.', example='3'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. You can call the [DescribeInstances](~~DescribeInstances~~) operation to query the ID of the instance.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: long(name='Period', description='The subscription duration of the instance. Unit: months. Valid values: **1** to **9**, **12**, **24**, and **36**.

This parameter is required.', example='12'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model TransformToPrePaidResponseBody = {
  endTime?: string(name='EndTime', description='The time when the instance expires after the billing method of the instance is changed from pay-as-you-go to subscription.', example='2019-01-18T16:00:00Z'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='111111111111111'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='426F1356-B6EF-4DAD-A1C3-DE53B9DAF586'),
}

model TransformToPrePaidResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransformToPrePaidResponseBody(name='body'),
}

/**
 * @summary Changes a pay-as-you-go Tair (Redis OSS-compatible) instance to a subscription instance.
 *
 * @description For more information about how to change the billing method in the Tair (Redis OSS-compatible) console, see [Switch to subscription](https://help.aliyun.com/document_detail/54542.html).
 * >  You cannot change the billing method of a Tair (Redis OSS-compatible) instance from subscription to pay-as-you-go.
 *
 * @param request TransformToPrePaidRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransformToPrePaidResponse
 */
async function transformToPrePaidWithOptions(request: TransformToPrePaidRequest, runtime: $RuntimeOptions): TransformToPrePaidResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.autoRenewPeriod)) {
    query['AutoRenewPeriod'] = request.autoRenewPeriod;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TransformToPrePaid',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes a pay-as-you-go Tair (Redis OSS-compatible) instance to a subscription instance.
 *
 * @description For more information about how to change the billing method in the Tair (Redis OSS-compatible) console, see [Switch to subscription](https://help.aliyun.com/document_detail/54542.html).
 * >  You cannot change the billing method of a Tair (Redis OSS-compatible) instance from subscription to pay-as-you-go.
 *
 * @param request TransformToPrePaidRequest
 * @return TransformToPrePaidResponse
 */
async function transformToPrePaid(request: TransformToPrePaidRequest): TransformToPrePaidResponse {
  var runtime = new $RuntimeOptions{};
  return transformToPrePaidWithOptions(request, runtime);
}

model UnlockDBInstanceWriteRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model UnlockDBInstanceWriteResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', description='The name of the instance.', example='r-2ev03avw0r0552***'),
  requestId?: string(name='RequestId', description='The request ID.', example='5D622714-AEDD-4609-9167-F5DDD3D1****'),
  taskId?: long(name='TaskId', description='The task ID.', example='10****'),
}

model UnlockDBInstanceWriteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnlockDBInstanceWriteResponseBody(name='body'),
}

/**
 * @summary Removes the write lock from an instance. After the instance is unlocked, it supports both read and write operations.
 *
 * @param request UnlockDBInstanceWriteRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnlockDBInstanceWriteResponse
 */
async function unlockDBInstanceWriteWithOptions(request: UnlockDBInstanceWriteRequest, runtime: $RuntimeOptions): UnlockDBInstanceWriteResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnlockDBInstanceWrite',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes the write lock from an instance. After the instance is unlocked, it supports both read and write operations.
 *
 * @param request UnlockDBInstanceWriteRequest
 * @return UnlockDBInstanceWriteResponse
 */
async function unlockDBInstanceWrite(request: UnlockDBInstanceWriteRequest): UnlockDBInstanceWriteResponse {
  var runtime = new $RuntimeOptions{};
  return unlockDBInstanceWriteWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags from the instance. Valid values:

*   **true**: removes all tags from the instance.
*   **false** (default): does not remove all tags from the instance.

> If you specify both this parameter and the **TagKey.N** parameter, this parameter does not take effect.', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/473763.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The IDs of the instances.

This parameter is required.', example='r-bp1zxszhcgatnx****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **INSTANCE**.

This parameter is required.', example='INSTANCE'),
  tagKey?: [ string ](name='TagKey', description='The list of tag keys.', example='demokey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='601B6F25-21E7-4484-99D5-3EF2625C****'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from Tair (Redis OSS-compatible) instances.
 *
 * @description *   You can remove up to 20 tags at a time.
 * *   If a tag is removed from an instance and is not added to other instances, the tag is deleted.
 * You can also remove tags from instances in the Tair (Redis OSS-compatible) console. For more information, see [Remove a tag](https://help.aliyun.com/document_detail/119157.html).
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: $RuntimeOptions): UntagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.all)) {
    query['All'] = request.all;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UntagResources',
    version = '2015-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes tags from Tair (Redis OSS-compatible) instances.
 *
 * @description *   You can remove up to 20 tags at a time.
 * *   If a tag is removed from an instance and is not added to other instances, the tag is deleted.
 * You can also remove tags from instances in the Tair (Redis OSS-compatible) console. For more information, see [Remove a tag](https://help.aliyun.com/document_detail/119157.html).
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

